Push To Talk first recording bug

How to reproduce:

  1. Launch ptt app
  2. join channel
  3. call requestBeginTransmitting
  4. in delegate method didActivate audioSession prepare AVAudioRecorder and call record
  5. Error: AVAudioRecorder.record() returns false

If I reinstantiate and run AVAudioRecorder.record() right away then it returns true. It happens only on first audio recording after app launch.

  • Did you set up any Microphone permission entries in the info plist?

  • MobileTen, of course

Add a Comment

Replies

Make sure that you’re doing the following things in your PushToTalk app:

  • Enable the “Audio, AirPlay, and Picture in Picture” and “Push to Talk” background modes in your Xcode project
  • Enable the “Push to Talk” capability in your Xcode project
  • Request or check microphone recording permission when initially setting up the app during launch and not each time you record
  • Set the AVAudioSession category to playAndRecord during initial app start up and do not change it during the recording process. Changing the audio category during the recording process introduces significant delay.
  • We recommend the use of the AVAudioEngine API for the best recording performance

If you’re still encountering problems I’d recommend submitting a DTS ticket for assistance.