Hello all!
Since Im not getting any useful answers in the FMOD forum, you're my only hope.
Im implementing FMOD into my game Engine, but its not working as it should.
The sound is getting blurry, and the return value of system->playSound() is FMOD_ERR_MEMORY (but im only loading 1 mp3 file here).
It works well if I do the same in a console application, but when it comes to a window application Im getting the error.
At the FMOD forum, they told me:
Quote:You are running your code in such a tight loop that you are stalling the whole operating system. Put a sleep somewhere in your loop.
Im using FMOD like this inside my gameloop:
//game loop
if(PeekMessage(&msg, 0, 0, 0, PM_REMOVE)
{
//bla bla
}
else
{
mInput->Update();
if(mInput->KeyDown(SPACE))
fmod_system->playSound(FMOD_CHANNEL_FREE, fmod_sound, false, 0);
fmod_system->update(); //Im guessing that this is causing the OS stalling.
}
But a Sleep() call inside my gameloop would be horrible for the frame rate.
So my question to you is: How do you update / play your sound in your gameloop?
Some code would be great!
Thanks
-----------------------------------------------------I demand more toasties!