AVAudioRecorder freezes when paused too many times before stopping

I noticed that AVAudioRecorder (iOS) freezes when I pause and resume 8 or more times during recording. It hangs endlessly on the simulator, and on the device I get the following errors:

AudioQueueStop publication post for killing mediaserverd

Does anyone know how to prevent this, or is there a workaround? My problem is that I try to upload the file to AVAudioPlayer after that, and as a result, the downloaded file has no duration (and does not play). The strange thing is that I can save the file and then play it just fine. I'm still not sure at what point the file is being played, but I hoped that if there was a problem with the recorder, I would not need a workaround.

+3
source share
1 answer

I have the same problem and I thought I found a workaround that seems to work for small records, but it still freezes for longer ones:

[NSThread detachNewThreadSelector: @selector (stop) toTarget: myrecorder withObject: nil]

maybe it can work for you, if you're lucky, did you send a bug report? i will write now

+1
source

Source: https://habr.com/ru/post/1778392/


All Articles