Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AUIOClient_StartIO failed (-66628)

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...

like image 568
edwardtoday Avatar asked Mar 17 '23 19:03

edwardtoday


1 Answers

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.

like image 154
edwardtoday Avatar answered Mar 30 '23 10:03

edwardtoday