0
0

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?

  • You must to post comments
0
0

No, it was inside the gamemain() as stated above it doesn’t work thier only directly in the winmain… all well after the window is created.

  • You must to post comments
0
0

I got it it was my dumb play once check I had, the fmod was getting initialized and played every second so no sound came out:) Thanx fer all the help though guys:)

  • You must to post comments
0
0

I got fmod to work fine in a console app I had it just won’t work in the win app!:( Do I need to initialize DSound first or something?

  • You must to post comments
0
0

I put the FSOUND_setHWND() above the FSOUND_init()
and this happens!:(

GameMain.cpp
C:Program FilesMicrosoft Visual StudioMyProjectsmenudemoGameMain.cpp(99) : error C2065: ‘FSOUND_setHWND’ : undeclared identifier
Error executing cl.exe.

  • You must to post comments
0
0

HMMMM Don’t I feel stupid! Cant believe I missed that… Well at any rate it still doesn’t work.

  • You must to post comments
0
0

Do I need wincompat.h? Cause if I do I cant use it, it calls for unistd.h which I don’t have on my computer…

  • You must to post comments
0
0

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…

bool PlayGameSound()
{
FMUSIC_MODULE *mod;

if (FSOUND_GetVersion() < FMOD_VERSION)
{
InitFail(“wrong version!”);
}

//INITIALIZE
FSOUND_SetDriver(FSOUND_OUTPUT_DSOUND);
FSOUND_SetMixer(FSOUND_MIXER_QUALITY_AUTODETECT);

if (!FSOUND_Init(44100, 16, FSOUND_INIT_GLOBALFOCUS))
{
InitFail(“Can not init fsound!”);
}

// LOAD SONG
mod = FMUSIC_LoadSong(“/fmod/media/invtro94.s3m”);
if (!mod)
{
InitFail(“Cannot Load Song!”);
}

FMUSIC_SetMasterVolume(mod, 170);

// PLAY SONG

FMUSIC_PlaySong(mod);
return true;}

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();

  • You must to post comments
0
0

I didn’t see any win32 app samples only console examples but I will check again thanks for your help:)

  • You must to post comments
0
0

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:

while(TRUE)
{
// 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)
break;
TranslateMessage(&msg);
DispatchMessage(&msg);
}

    // 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?

  • You must to post comments
0
0

Where were you trying to init the sound before when it wasn’t working? I’m guessing it was before the window was created.

  • You must to post comments
Showing 10 results
Your Answer

Please first to submit.