Does the OS has dedicated volume levels for each AVAudioSessionCategory.

We have an VoiP application, our application can be configured to amplify the PCM samples before feeding it to the Player to achieve volume gain at the receiver.

In order to support this, We follow as below.

If User has configured this Gain Settings within application,

Application applies the amplification for the samples to introduce the gain. Application will also set the AVAudioSessionCategory to AVAudioSessionCategoryPlayback Provided the User has chosen the output to Speaker.

This settings was working for us but we see there is a difference in behaviour w.r.t Volume Level System Settings between OS 26.3.1 and OS 26.4

When user has chosen earpiece as Output, then we will set the AVAudioSessionCategory to AVAudioSessionCategoryPlayAndRecord. User would have set the volume level to minimum.

When user will change the output to Speaker, then we will set the AVAudioSessionCategory to AVAudioSessionCategoryPlayback. The expectation is, the volume level should be of AVAudioSessionCategoryPlayback what was set earlier instead we are seeing the volume level stays as minimum which was set to AVAudioSessionCategoryPlayAndRecord

Could you please explain about this inconsistency w.r.t Volume level.

Application will also set the AVAudioSessionCategory to AVAudioSessionCategoryPlayback Provided the User has chosen the output to Speaker.

Why are you doing this instead of just staying in PlayAndRecord?

More specifically, as a CallKit app, you need to leave your category alone, as changing your category state can mean you're no longer running with the "phone" category. That can have much broader and unpleasant consequences like, for example, allowing other apps to interrupt your calls without warning.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

Does the OS has dedicated volume levels for each AVAudioSessionCategory.
 
 
Q