Record AVAudioPlayer output using AVAudioRecorder

强颜欢笑 提交于 2019-12-01 08:14:42

It is not possible to record AVAudioPlayer output as input to AVAudioRecorder for recording. You can use audio buffer to store played files and save it to a file.

dizy

It would probably be easier to help if we saw your code.

You should also check out the following link to see if you have your AVAudioRecorder setup correctly: How do I record audio on iPhone with AVAudioRecorder?

Although that link shows how to setup a recording from the mic, it might still be helpful to you.

Was facing the same problem. Solved the problem by setting the AVAudioSession category to AVAudioSessionCategoryPlayback mode. This is my working code:

AVAudioSession *audioSession = [AVAudioSession sharedInstance];
audioSession.delegate = self;
[audioSession setCategory:AVAudioSessionCategoryPlayback error:nil];
[audioSession setActive: YES error: nil];

Also make sure that the audio recording has been finished successfully by implementing:

   -(void) audioRecorderDidFinishRecording:(AVAudioRecorder *)recorder successfully:(BOOL)flag
{
    NSLog(@"Recording success:%@",flag ? @"YES" : @"NO");
}

And check that you have added <AVAudioSessionDelegate,AVAudioRecorderDelegate,AVAudioPlayerDelegate>

in your interface declaration.

Hope it helps, at least to look for something else.

I'm having the same issue here, I'm trying to record a mix of different sounds played at different times with a main track playing, what I found is that AVAudioRecorder records only from the mic, so it would work.

What I found, still have to read doc and test it, is the Audio Converter Services, I think that may work, but I have just read a few lines.

Once again, sorry to tell you, but you're looking the wrong way, I hope my answer helps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!