Objective c 分割音频文件

Objective c 分割音频文件,objective-c,audio,split,avaudioplayer,Objective C,Audio,Split,Avaudioplayer,我正在使用AVAudioRecorder和AVAudioPlayer录制和播放音频。我想通过放置标记,在AVAudioPlayer中插入特定时间的音频。有人能帮我怎么做吗?试试这个: -(void)Play { AVAudioPlayer *avPlayer = [[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL fileURLWithPath:[FileDetailsRec valueForKey:@"Path"]] error

我正在使用AVAudioRecorder和AVAudioPlayer录制和播放音频。我想通过放置标记,在AVAudioPlayer中插入特定时间的音频。有人能帮我怎么做吗?

试试这个:

    -(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];
}
请检查一下。。。。我希望这对你有帮助

试试这个:

    -(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];
}
请检查一下。。。。我希望这对你有帮助


我想分割主音频并插入新音频。我想分割主音频并插入新音频。