iOS使用AudioUnit錄音,在錄音回調中使用AudioUnitRender播放錄製的人聲時,
返回-10876這個錯誤。
這裏https://www.osstatus.com/search/results?platform=all&framework=all&search=-10876查詢到錯誤碼:
kAudioUnitErr_NoConnection。
解決方法:
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback
error:nil];
改成:
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord
error:nil];
如果還不行,看看別的地方是不是設置了AVAudioSessionCategoryPlayback。