Is there something special that needs to be done to make fmod work in a windows app? I got everything in thier everything compiles fine but still no sound. I initialize, set ou method, load file, play file and clean up at Game_terminat. whats the dilly yo?
- Anonymous asked 16 years ago
I put the FSOUND_setHWND() above the FSOUND_init()
and this happens!:(
C:Program FilesMicrosoft Visual StudioMyProjectsmenudemoGameMain.cpp(99) : error C2065: ‘FSOUND_setHWND’ : undeclared identifier
Error executing cl.exe.
I have error checking in every step… I’m using the Global focus, and the function I wrote works fine in a console app just not in my dx app…
if (FSOUND_GetVersion() < FMOD_VERSION)
if (!FSOUND_Init(44100, 16, FSOUND_INIT_GLOBALFOCUS))
InitFail(“Can not init fsound!”);
// LOAD SONG
mod = FMUSIC_LoadSong(“/fmod/media/invtro94.s3m”);
InitFail(“Cannot Load Song!”);
// PLAY SONG
I get no errors when I compile and no errors when I run… Just doesn’t play… In my gamemain() I call PlayGameSound()… And in my console app the only thing different is the “InitFail” is “cout <<” and I call the PlayGameSound in the main();
Ok, now this is funny. If I call the PlayGameSound() inside the directly inside winmain() everything works. If I call PlayGameSound() inside GameMain() which intern GameMain() gets called in the message handler here:
// Grab any Windows messages that are for us
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
// Send these messages to WindowProc
if (msg.message == WM_QUIT)
// Call our Game function else if (G.bActive) Game_Main(); }
And yes I have the PlayGameSound checked to make sure it gets called only once… What am I doing wrong? Anyone?
Please login first to submit.