In an app that has both microphone input and audio playback views in 2 tabs. No matter what view I enter first, it works all right. Things are still working when I switch to the second tab.
When I switch back to the first tab, the error occurs.
ERROR: [0x1995d4310] 1230: AUIOClient_StartIO failed (-66628)
Error: Microphone failed to start fetching audio (-66628)
No exception threw. App crashes...
It was actually a problem with AVAudioSessionCategory
.
I change the following code
[[AVAudioSession sharedInstance]
setCategory:AVAudioSessionCategoryPlayback
error:&error];
to
[[AVAudioSession sharedInstance]
setCategory:AVAudioSessionCategoryPlayAndRecord
error:&error];
And it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With