Question

I am working on the game. And I have some issue with sounds.

I use system sounds to acknowledge a player, when he/she presses a button. These sounds respect the volume set by a player, when other sounds are playing (I use AVAudioPlayers and AudioQueues). But when a system sound is only to play, it ignore a volume set by player and plays at a ringer's volume.

How to force system sounds to respect a volume set by a player even when is no other sounds played?

Was it helpful?

Solution

How are your players (I assume you mean the people playing the game) setting the volume -- through the device's volume control, or through your app interface? If the latter, then this won't work, since system sounds should always play at the device volume.

According to the Multimedia Programming Guide, "Sounds play at the current system audio volume, with no programmatic volume control available."

I don't know why your system sounds would change volume when an AVAudioPlayer sound is playing. If that's the case, can you loop a silent sound with AVAudioPlayer when you're not playing other sounds? Otherwise I would try playing all sounds with AVAudioPlayer so that you have direct control over the volume.

OTHER TIPS

Assuming you are meaning that players are setting the volume using the side volume buttons on the device:

I had the same problem getting SystemSound to respect the volume buttons but found a setting in "Settings"/"Sounds"/"Ringer and Alerts"/"Change With Buttons" that was "OFF" by default. Switching that to "ON" made it work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top