Skip to main content

Changing BackgroundSound volume runtime?

No replies
skinhat
Offline
Joined: 2009-02-26
Points: 0

I'm trying to change the volume of a BackgroundSound runtime. I thought I could do it by setting

BackgroundSound.setInitialGain(volume );

but doesn't seem to do anything. I think I have all the capabilities set eg:
drone.setCapability( Sound.ALLOW_ENABLE_WRITE );
drone.setCapability( Sound.ALLOW_INITIAL_GAIN_WRITE );
drone.setCapability(Sound.ALLOW_SOUND_DATA_WRITE);
drone.setCapability(Sound.ALLOW_SCHEDULING_BOUNDS_WRITE);
drone.setCapability(Sound.ALLOW_CONT_PLAY_WRITE);
drone.setCapability(Sound.ALLOW_RELEASE_WRITE);
drone.setCapability(Sound.ALLOW_DURATION_READ);
drone.setCapability(Sound.ALLOW_IS_PLAYING_READ);
drone.setCapability(Sound.ALLOW_LOOP_WRITE);
drone.setCapability( Sound.ALLOW_PAUSE_READ);
drone.setCapability( Sound.ALLOW_PAUSE_WRITE);

The reason I want to change the volume of the background sound is that I have wind in a game I'm writing and I want to change the volume of the wind depending on wind strength.