Frictional Games Forum (read-only)

Full Version: Sounds crashing the game
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So, i've successfully compiled and ran the Penumbra Overture inside Visual Studio 2010 after removing the menu music starter in source code. And the major problem is (obviously) related to sounds and music. Everytime a sound should be loaded and played, the game crashes and VS asks me if i want to break or continue with the execution. If i dint remove these lines in MainMenu.cpp, the game wouldnt even load:
Code:
mpInit->mpGame->GetSound()->GetMusicHandler()->Play("music_theme.ogg",1,5.0f,false);

            if(pSoundHandler->IsPlaying("gui_rain1")==false)
                pSoundHandler->PlayGui("gui_rain1",true,1);

and when i did remove these lines and i press some button in the main menu, for example the Options button, it should play the button click sound (some kind of thump) the game crashes and the error seems to be in ope.c file. And that file a default windows file and handles some windows file opening functions. I think the error is with the OALWrapper or with other sound system because when i dint remove those lines mentoined above, the game crashes at the Loading... screen and VS says that the error is in MainMenu.cpp at line 2517 (wich is: mpInit->mpGame->GetSound()->GetMusicHandler()->Play("music_theme.ogg",1,5.0f,false); )
Any advice will be appreciated.
I would start debugging and figure out exactly what value is being sent to the file opening methods..

In the latest trunk there was some slight changes to the way the file handling routines are registered w/ OALWrapper that *may* be a possible cause to your grief. You may need to update the version of libvorbisfile (and libogg while you are at it) in the dependencies zip.
OK, i think the problem is with loading the actual files. The error seems to be in OAL_Loaders.cpp at line 77
Code:
return gpDevice->LoadStream(asFilename);

full function:
Code:
cOAL_Stream* OAL_Stream_Load(const string &asFilename)
{
    if (gpDevice == NULL) return NULL;

       return gpDevice->LoadStream(asFilename);
}

Seems to have problems here too:
Code:
    /////////////////////////////////
    //Create from file
    if(pStream->CreateFromFile(asFilename))
    {
        mlstStreams.push_back(pStream);
        //hpl::Log("Loaded stream %s\n", pStream->msName.c_str());
    }
    else
    {
        delete pStream;
        pStream = NULL;
    }

    return pStream;

}
Everything works now as i took an older OALWrapper source from github Big Grin