[Solved]Run time error - help

deshan

16-12-2009 04:37:34

Hi All I am just start to using ogreoggsound. Done build the ogreoggsound but getting a runtime error.
Expresssion : ms_singleton();
I have done following things, Could you please tell me what else i missed.


1. I have copied OgreOggSound_d.dll to OgreSDK\bin\debug

2. added Plugin=OgreOggSound_d to Plugins.cfg

3. root = Ogre::Root();
root.loadPlugin("OgreOggSound_d");

4. mSound = new OgreOggSound::OgreOggSoundManager();
mShotSound = mSound->createSound("_sound", "1vs0_JuniorGroove.ogg", false, true);
hNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
hNode->attachObject(mShotSound);

5. bool frameStarted(const FrameEvent &evt)
{
...
mSound->update(evt.timeSinceLastFrame);
}



I am getting a run time error, have i missed any?
help please

deshan

16-12-2009 05:03:02

Sorry
Now i figured out the problem.
I would like to share what I have done.


1. copied OgreOggSound_d.dll to OgreSDK\bin\debug

2 . added Plugin=OgreOggSound_d to Plugins.cfg

3. mSound = OgreOggSound::OgreOggSoundManager::getSingletonPtr();
mSound->init();
mShotSound = mSound->createSound("_sound", "1vs0_JuniorGroove.ogg", false, true);

4. bool frameStarted(const FrameEvent &evt)
{
...
mSound->update(evt.timeSinceLastFrame);
}

5. bool keyPressed(const OIS::KeyEvent &e)
{
...
case OIS::KC_UP:
mShotSound->play();
break;
}


5 steps done.
Thnax OgreOGGSOUND Moderators

EDIT :
project includes

include;
"$(OGRE_HOME)\include";
"$(OGRE_HOME)\samples\include";
C:\OpenALSDK\include;
D:\config\OgreOggSound\include


Additional Libraries
"$(OGRE_HOME)\lib";
D:\config\OgreOggSound\dependencies\libs


Input
OgreMain_d.lib
OIS_d.lib
OgreOggSound_d.lib


Hope someone can use this

stickymango

16-12-2009 15:21:29

Hi deshan,

that should all be documented in here: viewtopic.php?f=19&t=8389&p=48756#p48756

your main problem was loading the library using loadPlugin() AND creating an instance of the soundmanager with new, you only need to do one or the other.

deshan

16-12-2009 16:27:40

I see. And latest svn update is little bit different form the stable release. Much better. Thank you for your work stickymango.
And we have decided to use OgreOggSound as our projects sound wrapper.

stickymango

16-12-2009 16:31:35

Yeah the stable SVN version is totally different to the trunk version, I'd recommend trunk as it has a lot of bug fixes since that stable release.

Glad the libs of use to you :D