2 Replies
      Latest reply on Jan 30, 2020 3:02 AM by andrey48
      invalidname Level 1 Level 1 (0 points)

        So this surprised me. If I use the volume switch with nothing playing to turn "sound effects" volume up really high, then call AudioServicesPlaySystemSound(), I get a nice loud sound…


        …unless I'm playing audio in some other app like Music or Pandora. In that case, the system volume attenuates the system sound volume. So, even if the sound effects volume had been set really high, if I'm playing some Apple Music or something and have its volume turned down, then the sound effect is much quieter than it would be if the system sound were playing by itself.


        Is there any way to preserve the sound effects volume behavior, regardless of whether other audio is playing? Doesn't seem like the session category makes a difference.



        • Re: Volume level for AudioServicesPlaySystemSound()
          theanalogkid Apple Staff Apple Staff (610 points)

          There are two volume settings you're talking about - Ringer/Alert Volume and Output Volume for the active audio session playing something.


          AudioServices APIs use the Ringer/Alert volume while other playback APIs will use the Output Volume setting which can be altered for a given active audio session by using the volume controls on the device or MPVolumeView if you're using that in your app.


          Note that some confusion seems to surface when a mixture of both AudioServices and other Audio playback APIs are being used when attempting to change volumes using the hardware volume controls if the device has the Sound setting "Change With Buttons" turned ON for the Ringer/Alert volume - with this ON, the hardware volume controls will now affect both Ringer/Alert volume as well as Output volume depending on the state of the app and what's actually being played with what API.

            • Re: Volume level for AudioServicesPlaySystemSound()
              andrey48 Level 1 Level 1 (0 points)

              I'm experiencing the same behavior.

              When I play sound using AudioServices API while sound from video player is played, then sound played by AudioServices is much quieter than it would be if no video is played.

              It means that AudioServices API play sound with volume not equal to Ringer/Alert volume but with Output volume while playing some other audio.