小编Sri*_*i S的帖子

在iOS中同时录制和播放音频

我正在尝试录制时同时播放录制的内容.目前我正在AVAudioRecorder用于录制和AVAudioPlayer播放.

当我试图同时播放内容时,没有任何东西在播放.请找到我正在做的伪代码.

如果我在停止录制后做同样的事情一切正常.

AVAudioRecorder *recorder;  //Initializing the recorder properly.
[recorder record];
NSError *error=nil;
NSUrl recordingPathUrl;     //Contains the recording path.
AVAudioPlayer *audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:recordingPathUrl 
                                                                    error:&error];
[audioPlayer  prepareToPlay];
[audioPlayer  play];
Run Code Online (Sandbox Code Playgroud)

你能不能让任何人告诉我你的想法或想法?

iphone avfoundation avaudioplayer avaudiorecorder ios

9
推荐指数
2
解决办法
6586
查看次数