我正在使用AVAudioRecorder和AVAudioPlayer录制和播放音频。我想通过放置标记在AVAudioPlayer中插入具有特定时间的音频。任何人都可以帮我解决这个问题吗?
答案 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];
}
请检查一次....我希望,它可以帮助你......