0
0

I was just fiddling around this evening with the latest version (4.02.01), and I wrote the following program:

[code:28i3nwrk]#include "fmod.hpp"

using namespace FMOD;

int main()
{
System * pSystem = 0;
Sound * pSound = 0;
Channel * pChannel = 0;

System_Create(&pSystem);
pSystem->init(64, FMOD_INIT_NORMAL, 0);
pSystem->createSound("t.wav", FMOD_2D | FMOD_SOFTWARE, 0, &pSound);
pSystem->playSound(FMOD_CHANNEL_FREE, pSound, false, &pChannel);
pChannel->setDelay(0, 500);
bool isPlaying = true;
while(isPlaying)
{
    pChannel->isPlaying(&isPlaying);
}
pSound->release();
pSystem->release();
return 0;

}
[/code:28i3nwrk]

This program never exits, because isPlaying() always returns true!

If I remove the setDelay() call, or create the sound as a stream, then it works properly. If I do create it as a stream, then it exits properly, but doesn’t wait the extra time at the end (tested by setting enddelay to something much longer, like 10000ms). Also, if I set the enddelay parameter to zero, it also works properly (which would make sense).

t.wav, in this case, is an 8-bit, 11KHz mono wave.

Cheers!

  • Guy
  • You must to post comments
0
0

Call System::update() in your main loop. If still no good then also include a small sleep as well e.g. Sleep(10);

  • You must to post comments
0
0

Ahah! That fixed it.

Thanks, Andrew!

Some note to this effect in the documentation would probably be useful 😀

  • G
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.