0
0

Hi there, wonder if anyone else is getting this possible bug? I am trying to stream a 0.75 second long 32bit 44100hz mono wav file with the following code.

FMOD_SOUND* pFMODSound = 0
FMOD_CHANNEL* pChannel = 0;

FMOD_System_CreateSound(pFMODSystem, "BubblePop1.wav", FMOD_DEFAULT | FMOD_LOOP_NORMAL | FMOD_CREATESTREAM, 0, &pFMODSound);

FMOD_Sound_SetLoopCount(this->pFMODSound, 0);

FMOD_System_PlaySound(pFMODSystem, pFMODSound, 0, false, &pChannel);

FMOD_Channel_SetLoopCount(this->pChannel, 0);

The code above set things up so that I have the option of turning looping on and off after creating the Stream. When I turn the looping off as in above there is sort of an echo, or an extra bit of sound at the end of the sound effect. When I put looping back on all seems to work. If I create the stream without FMOD_LOOP_NORMAL then I am unable to make the Stream Loop. I get the same results when I use FMOD_System_CreateStream and omit FMOD_CREATESTREAM from the creation parameters.

I am using MINGW the libFmod.a library (encountered this problem with 1.08.04 and 1.09.04)

Is this a bug or am I doing something wrong?

  • You must to post comments
0
0

Hi,
setLoopCount is a bit different to other functions in that it doesn’t cause a re-flush of the stream buffer. Streams are typically large files, so it buffers the sound data in advance, and if your file fits inside the stream buffer multiple times (as you told it to load as looping during creation), it will be too late to re-read and you might hear it multiple times.

Try turning looping on and off in conjunction with your loop count, with Sound::setMode (or just use this function exclusively) or Channel::setMode and it should work.

  • Brett Paterson

    to add to this, I will update the code to handle this case better for the future, it should be working in the next update.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.