0
0

I have a problem with FMOD_Channel_SetVolume API function :(
Sample code:

[code:2khtbz6j]
FMOD_SYSTEM *sys;
FMOD_CHANNEL *channel;
FMOD_SOUND *sound;

FMOD_System_Create(&sys);
FMOD_System_SetPluginPath(sys, "sound");
FMOD_System_SetOutputByPlugin(sys, 0);
FMOD_System_Init(sys, 32, FMOD_INIT_NORMAL, 0);

char *name = "c:\mus.mp3";

FMOD_System_CreateSound(sys, name, FMOD_SOFTWARE | FMOD_CREATESTREAM, 0, &sound);
FMOD_System_PlaySound(sys, FMOD_CHANNEL_FREE, sound, 0, &channel);

.... (some code)
FMOD_Channel_SetVolume(channel, 0.1); // This string sets volume to 100%
.... (some code)
FMOD_Channel_SetVolume(channel, 0.3); // This string leaves volume unchanged (100%)
.... (some code)
FMOD_Channel_SetVolume(channel, 0); // This string sets volume to 0% (silent)
.... (some code)
FMOD_Channel_SetVolume(channel, 0.1); // This string sets volume to 100%
[/code:2khtbz6j]

In the “debug” version there is all ok, but in the “release” it doesn’t work… :(
FMOD_Channel_SetVolume returns 0 (no error).

what’s wrong?

  • You must to post comments
0
0

I wrote:

[code:q6nxzdyo]
FMOD_System_PlaySound(sys, FMOD_CHANNEL_FREE, sound, TRUE, &channel);

.... (some code)
FMOD_Channel_SetVolume(channel, 0.1); // But this string sets volume to 100% again (in release version)
FMOD_Channel_SetPaused(channel, FALSE); // (Volume sets to 100%)
.... (some code)
FMOD_Channel_SetVolume(channel, 0.3); // This string leaves volume unchanged (100%)
.... (some code)
FMOD_Channel_SetVolume(channel, 0); // This string sets volume to 0% (silent)
.... (some code)
FMOD_Channel_SetVolume(channel, 0.1); // This string sets volume to 100%
.... (some code)
FMOD_Channel_SetPaused(channel, TRUE);
FMOD_Channel_SetVolume(channel, 0.3);
FMOD_Channel_SetPaused(channel, FALSE); // Volume remains 100% again (in release version)
[/code:q6nxzdyo]

:(

  • You must to post comments
0
0

When i use /Od or /O1 (no optimization / minimize size) compiler options there is all ok (intel c++ compiler 9.0!!!), but when i use any of “maximize speed” optimization (O2, O3, Ox) there is a problem…. :(

i think there is a compiler bug…

executable, compiled with mingw or gcc works fine

playsound example with SetVolume works too (all compilers)…

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.