0
0

I use this:

[code:35lpy8cn]
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!

  • You must to post comments
0
0

I think there’s something we’re not seeing in your code that you have left out causing your problem.

There are a heap of examples using setVolume. Maybe your variable is an int or something and not a float?

  • You must to post comments
0
0

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.

Best regards,
Felics

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.

  • You must to post comments
0
0

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.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.