OgreOggSound can't play sound

linux111

13-04-2015 11:16:38

Hello,guys

I use the OgreOggSound to play sound in the game, but it doesn't work, here is my code:

OgreOggSound::OgreOggSoundManager::getSingletonPtr()->createSound("sound","dvorak_symphony_9_4.ogg",false,true,true);
OgreOggSound::OgreOggSoundManager::getSingletonPtr()->getSound("sound")->setVolume(1);
OgreOggSound::OgreOggSoundManager::getSingletonPtr()->getSound("sound")->setMinVolume(1);
OgreOggSound::OgreOggSoundManager::getSingletonPtr()->getSound("sound")->setMaxVolume(1);
OgreOggSound::OgreOggSoundManager::getSingletonPtr()->getSound("sound")->play(true);


What should I do?

stickymango

16-07-2015 21:59:18

Ensure the sound isn't mono, otherwise there isn't much wrong with that code other then unnecessary volume calls.

Try calling disable3D() on the sound.