拆分音频文件

时间:2016-05-23 06:34:45

标签: objective-c audio split avaudioplayer

我正在使用AVAudioRecorder和AVAudioPlayer录制和播放音频。我想通过放置标记在AVAudioPlayer中插入具有特定时间的音频。任何人都可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

试试这个:

    -(void)Play
{
    AVAudioPlayer *avPlayer = [[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL fileURLWithPath:[FileDetailsRec valueForKey:@"Path"]] error:nil];
    [avPlayer setCurrentTime:5.01f];
    [avPlayer prepareToPlay];
    [avPlayer play];
    objTimer = [NSTimer  scheduledTimerWithTimeInterval:1.07f target:self selector:@selector(stop) userInfo:nil repeats:NO];
}

-(void)stop
{ 
    [objTimer invalidate];
    [avPlayer stop];
}

请检查一次....我希望,它可以帮助你......

https://documentation.apple.com/en/soundtrackpro/usermanual/index.html#chapter=6%26section=18%26tasks=true

相关问题