We have application using PTT Framework to record audio messages when app is backgrounded. Right now we are using AVAudioRecorder for that purpose. And problem is one specific user has frequent issue - recorded audio contains only silence. I've checked almost everything I can imagine but didn't find any possible reason of issue.
Conditions:
- AVAudioRecorder uses following configuration:
[ AVEncoderAudioQualityKey: AVAudioQuality.low.rawValue, AVFormatIDKey : kAudioFormatMPEG4AAC, AVNumberOfChannelsKey: 1, AVSampleRateKey: 16000.0 ]
- App waits both
didBeginTransmitting
anddidActivate audioSession
fromPTChannelManager
(audio session hasplayback
category at that moment) - App does
AVAudioSession
category change toplayAndRecord
- App gets
routeChangeNotification
withcategoryChange
and category =playAndRecord
- There is no any interruption notifications from
AVAudioSession
during recording - There is no any error notification from
AVAudioRecorder
Any idea what exactly I do wrong? Is there anything else I should check?
Thanks in advance.
P.S. it looks like recording audio with AudioUnit has the same issue, but let's exclude it from question atm for simplicity.