[Solved]Crash on init()

mcimolin

30-06-2010 23:26:45

I'm new to using OgreOggSound, but I followed the demo program in the SVN, and I think I did everything right,
However, every time I start my application it crashes at mSoundManager.init() and I have no idea why. I've tried
recompiling the .dll but with no success. Is there something else I should be building?

I'm using Ogre 1.7.0 and Visual Studio 2008 V9.

#include "AudioCore.h"

/*
Constructor
*/
AudioCore::AudioCore(){
mSoundManager = OgreOggSound::OgreOggSoundManager::getSingletonPtr();
}


/*
Destructor
*/
AudioCore::~AudioCore(){
delete mSoundManager;
}


/*
Iinitializes the sound manager
*/
void AudioCore::init(){
mSoundManager->init();
sCrash = mSoundManager->createSound("Crash", "Crash.ogg", true, false, false);
sBackground = mSoundManager->createSound("Background", "Background.ogg", true, true, false);
}


/*
Plays a sound effect
*/
void AudioCore::playSoundEffect(){
sCrash->play();
}

/*
Plays the background music
*/
void AudioCore::playBackgroundSound(){
sBackground->disable3D(true);
sBackground->play();
}


/*
Updates the sounds
*/
void AudioCore::update(Ogre::Real time){
mSoundManager->update(time);
}


/*
Returns sCrash
*/
OgreOggSound::OgreOggISound* AudioCore::getSoundEffect(){
return sCrash;
}


/*
Returns sBackground
*/
OgreOggSound::OgreOggISound* AudioCore::getBackgroundMusic(){
return sBackground;
}


Thanks in advance

stickymango

01-07-2010 19:07:46

More often then not this is a hardware/drivers issue so check those first, try the OpenAL examples first to see if they work.

Best thing to do is run in debug and step through the init() function, which platform are you using?

mcimolin

02-07-2010 18:14:40

Ya, looks like I had some corrupt drivers. Strange that it didn't seem to effect anything else though.

Thanks.

stickymango

02-07-2010 19:01:03

Yeah it is weird how that happens, glad you sorted it.

zydgyy

13-09-2011 05:58:26

how did u solve it?