iOS 16.2 beta 4 causes the AVAudioRecorder's .record() function to always return false

I've recently updated to 16.2 beta 4 and now I can't use the AVAudioRecorder at all. Calling the .record() function always returns false. There's nothing wrong when calling .prepareToPlay() or when setting the AVAudioSession's category to .record.

What's more, if I start a screen recording, with the mic enabled, and then make my way up to the point where the recorder is initialized, it'll work. Any other case, like disabling the mic for the screen recording, or starting the screen recording AFTER the recorder was initialized, will not work again. Has anyone run into this so far?

  • great!!!! thanks a lot ... too. struggling to several hours !!!!! as you say, very poor error handling at not to show an error describing what happen

Add a Comment

Accepted Reply

Found the issue. I was initializing the AVAudioRecorder BEFORE switching the AVAudioSession category to .record. At least as of 16.2 beta 4, you now have to initialize it AFTER setting the record category. All fine with me, it's probably the recommended approach, but an error reason would be nice when .record() returns false, I'd been at this for 7 hours total before I finally got it.

  • Thanks! You probably saved me about 7 hours of searching!

  • +1 to your karma. Still the issue in iOS 16.3 and this is still the solution. Thank you.

Add a Comment

Replies

Found the issue. I was initializing the AVAudioRecorder BEFORE switching the AVAudioSession category to .record. At least as of 16.2 beta 4, you now have to initialize it AFTER setting the record category. All fine with me, it's probably the recommended approach, but an error reason would be nice when .record() returns false, I'd been at this for 7 hours total before I finally got it.

  • Thanks! You probably saved me about 7 hours of searching!

  • +1 to your karma. Still the issue in iOS 16.3 and this is still the solution. Thank you.

Add a Comment