I use this:
err = soundSystem->playSound(FMOD_CHANNEL_FREE, sound, false, &channel);
err = channel->setVolume(someVolumeBetween0and1);[/code:35lpy8cn]
Even if err is FMOD_OK, the volume doesn’t change. Am I doing something wrong? Is there any way to change the volume for a sound(channel)? Is there other range for volume instead of [0, 1]?
Thanks for help!
- Felics asked 6 years ago
Hello Brett and thank you for your answer,
Here is the full code:
[code:1kej7ela]soundSystem->createStream(soundFile, FMOD_SOFTWARE | FMOD_LOOP_NORMAL| FMOD_2D, NULL, &sound);
soundSystem->playSound(FMOD_CHANNEL_FREE, sound, false, &channel);
channel->setVolume(volume * actorVolume * playerVolume);[/code:1kej7ela]
Where (volume * actorVolume * playerVolume) is in [0.f, 1.f], all of type float. Even the result is 0.f the volumes is the same, very loud.
I must say that the sound file is mp3 and I have same problem on PC and on iOS(both iPhone and iPad). In documentaion/revision.txt I have 24/08/10 4.32.01 – Stable branch update.
EDIT: If I change other states/properties of that channel they are changing fine. I can pause, stop, change position(for 3D sounds) and it’s working. Only volume can’t be changed.
EDIT 2: If I use getVolume, the returned value is the value I set with setVolume.
- Felics answered 6 years ago
Check the fmod examples. Adding 1 createsound call is not helping me get the picture. For all I know you are setting the volume to full again somewhere else in your code.
Use the playsound example, add a setvolume call after the playsound. It will work.
Please login first to submit.