0
0

I just started FMOD today and I have the following code:
[code:5nm5eftz]

include "fmod.h"

int main()
{
FSOUND_Init(44100, 32, 0);
FMUSIC_MODULE * mod = FMUSIC_LoadSong("song.mid");
FMUSIC_PlaySong(mod);
return 0;
}[/code:5nm5eftz]

Yet…my song won’t play. Why is that? This is on Windows XP, using MSVC++.NET[/code]

  • You must to post comments
0
0

You routine assumes FUSIC_PlaySong() only returns when the song has finished- trust me, that wouldn’t be too useful ๐Ÿ˜†

As a very crude test you could do this;
[code:2ocprnk2]

include "fmod.h"

int main()
{
FSOUND_Init(44100, 32, 0);
FMUSIC_MODULE * mod = FMUSIC_LoadSong("song.mid");
FMUSIC_PlaySong(mod);

do{
}while (FMUSIC_IsPlaying(mod));

return 0;
}[/code:2ocprnk2]

You should also be very certain that “mod” is a valid handle after the LoadSong call.

  • Matt
  • You must to post comments
0
0

you can add a sleep inside the loop or your cpu will eat your computer ๐Ÿ˜€
Btw, add also FMUSIC_FreeSong and FSOUND_Close after the loop.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.