iOS Audio Session

Details on how the Sinch SDK make use of iOS Audio Session.

If the application plays audio that doesn't originate from the Sinch SDK, certain guidelines should be followed. Additional information on Audio Session-related topics is available in the Audio Session Programming Guide.

Audio Session

When a call is established, the Sinch client activates the shared audio session (AVAudioSession). When the call is disconnected, the Sinch client deactivates the shared audio session. If the application wants to play audio in any other context, it needs to reactivate the shared audio session. This applies after each finished call.

Audio Session Categories

When a call is established the audio session category will be set to PlayAndRecord.

The Sinch SDK applies the audio session mode AVAudioSessionModeVoiceChat for improved voice quality.

At the end of each call, Sinch SDK restores:

  • audio session category
  • audio session category options
  • audio session mode

to their original values.

Audio Session Interruptions

When a user is a Sinch SDK call, someone might call users using the PSTN network, thus interrupting the application and make iOS play the regular native ringtone. If the native phone call ends within 30 seconds, the application will start running again. If not, the Sinch SDK call will be terminated.

SINAudioController

Applications that prefer to not use SINAudioController for playing sounds like progress tone are free to do so, but they should follow the guidelines for Audio Sessions and Audio Session Categories above.

We'd love to hear from you!
Rate this content:
Still have a question?
 
Ask the community.