Hello, sorry if this has been answered but I cannot find it.
(Sorry, I cannot seem to add tags to this thread, but it is a Windows and C++ question)
I want to know how I can change the volume of a 3D positional sound while it is already playing.
I know that I can change the volume of any NEW 3D sound with channel->setVolume(), however I do not know how to access an existing 3D sound created with that same channel, and change its master volume.
For example, I want to be able to have users change the sound volume in my program’s options window, and have the 3D sound’s volume change immediately.
All other non-3D sounds work by calling the channel->setVolume() function, however the 3D sounds do not.
How to I access these sounds and change their volumes?
Here is the general code I use to set up and play the sounds:
result = system->playSound(FMOD_CHANNEL_FREE, envSoundList[soundID], true, &channelList[soundID]);
result = channelList[soundID]->set3DAttributes(&pos, &vel);
result = channelList[soundID]->setPaused(false);
result = channelList[soundID]->setVolume( VGlobal::soundVolume );
//Called every frame
result = system->set3DListenerAttributes(0, &listenerpos, &vel, &forward, &up);