0
0

My game allows players turn on and off sound fx as well as adjust volume. Internally volume is adjusted with FSOUND_SetSFXMasterVolume. If the user disables sounds, the game calls FSOUND_Close after a small delay to free resources.

I’ve noticed a strange dependency between master fx volume and closing and restarting fmod. If my code follows the sequence below the final call to FSOUND_PlaySound plays at volume 30.

FSOUND_Init(44100, 8, 0);
FSOUND_SetSFXMasterVolume( 30 );
FSOUND_Close();
FSOUND_Init(44100, 8, 0);
sound = LoadSoundFx();
FSOUND_SetSFXMasterVolume( 245 );
FSOUND_PlaySound(FSOUND_FREE, sound );

If I remove the calls in the middle to FSOUND_Close and FSOUND_Init it works as expected. The sound plays at 245.

Am I missing something or is this bug? Would a workaround be to leave the master volume alone and use PlaySoundEx then set the volume per channel? Can anyone confirm that this will work across fmod shutdowns as expected?

-Brad

  • You must to post comments
0
0

I can reproduce this every time with the code in my original post.

Not sure if it matters, but my sample is a .ogg loaded from a resouce dll into system memory then loaded into fmod with:

FSOUND_Sample_Load( FSOUND_FREE, data, FSOUND_LOADMEMORY, size );

I am running WinXP Pro the standard 3.5 fmod. I’ll try setting the volume per channel, but it would be simpler if the master volume worked as expected.

-Brad

  • You must to post comments
0
0

Thanks, that fixed it.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.