iOS 16.1 beta 5 AVAudioSession Error

We are getting this error on iOS 16.1 beta 5 that we never saw before in any of the iOS versions.

[as_client]     AVAudioSession_iOS.mm:2374  Failed to set category, error: 'what'

I wonder if there is any known workaround for the same. iOS 16 has been a nightmare and lot of AVFoundation code breaks or becomes unpredictable in behaviour. This is a new issue added in iOS 16.1.

I had a related problem - same line of AVAudioSession_iOS but with an error of "res!" - resource not avaiable. It was happening because I had already set the category on the shared instance of the AVAudioSession and called setActive(true) on it. Before iOS16 (well, watchOS9 in my case) it worked fine. Code had not changed for 2 years.

Hope it helps.

I had same issue. when I find someone resolve this in this link. In iOS 16+, before starting to record, you should change the category. At the same, after ending the record, you should resume the original category.

This fix my problem, hope it helps!

iOS 16.1 beta 5 AVAudioSession Error
 
 
Q