my app Eagle Screech! is out on Amazon, Google Play and iTunes right now, so you can test the below. I have music and sound effects loaded with the loadStream function. I set a simple toggle in the options screen to set the volume in-code for the channels I used for music, and for sound effects. Toggle on, the level is set to a certain volume; toggle off, and it sets it to zero.
It works perfectly on an Android which is my main device (it really shouldn’t be, but whatever) but as soon as I started testing on iOS devices, the volume would not change via the in-game toggle. The toggle works normally on both Windows and Mac simulators, as well as Android. I tested it on several different devices with both Android and iOS, and the issue only appears on iOS devices. I tested it on iOS devices with both iOS 6 and 5.1.1 installed.
I tested it with both loadSteam and loadSound, and the problem persists. The offending code (I believe) for my music.lua file is below. Please let me know if I can provide any additional data. As I said, the bug can be found in the released version of the app, which can be downloaded on Amazon, Google Play and iTunes. Thanks!
[lua]local function turnOffEffects()
for i=1, 28 do
if GameSettings.SoundOn == false then
audio.setMaxVolume( 0, { channel=4+(i*1) } )
end
end
end
local function turnOnEffects()
for i=1, 28 do
if GameSettings.SoundOn == true then
audio.setMaxVolume( .7, { channel=4+(i*1) } )
end
end
end
local function turnOffMusic()
for i=1, 4 do
if GameSettings.MusicOn == false then
audio.setMaxVolume( 0, { channel=0+(i*1) } )
end
end
end
local function turnOnMusic()
for i=1, 4 do
if GameSettings.MusicOn == true then
audio.setMaxVolume( .7, { channel=0+(i*1) } )
end
end
end[/lua] [import]uid: 135394 topic_id: 33816 reply_id: 333816[/import]