We have FX_ENABLE_SOUND and FX_SOUND_FMOD defined for iOS. Our current method for muting/unmuting sounds works in the FlashPlayer but does not work on a device.
// mute - no effect on device, soundTransform.volume is correctly 0, but volume still at 100%
_musicChannel.soundTransform = new SoundTransform(0, 0);
// unmute
_musicChannel.soundTransform = new SoundTransform(1, 0);
We have also tried saving the position, stopping the SoundChannel, and playing a new sound with the desired volume, but it seems like volume is always ignored. This all works on the PC. Any thoughts?
To be more specific, volume can be set when playing a new sound using the SoundTransform parameter of the play() function. However, if the sound is already playing, then there is no way to change the volume using the .soundTransform property.
Bump.
Anyone had this issue and worked around it? Our game really depends on the ability to fade music in and out. This is our last major bug before we can ship and can't seem to figure out a work around. Any help would be appreciated.
Did you manage to work around it?
I think I'm going to try it with ExternalInterface + SoundEvent
Okay it was my fault after all. I was setting the volume and panning one after another. Something like this:
// set the volume channel.soundTransform = new SoundTransform( newVolume, channel.soundTrasform.pan ); //set the pan channel.soundTransform = new SoundTransform( channel.soundTrasform.volume, newPan );
(I know it's a little bit silly not doing both at the same time. Besides this is a simplification, there were some encapsulations that didn't let me do both at the same time)
And when the second instruction was executed, the changes of the first weren't completed yet.
Any addtional help I can provide please let me know.