kungfoomasta
26-09-2009 00:18:14
Hey Sticky!
First off thanks for the library.
Last night I was playing sound on my laptop just fine. Today I tried on my tower at work, and the game crashes when trying to play a sound. I checked out OgreOggSound and built from source so I could provide some debug info, I hope it helps.
When the crash occurs I get the following message:
Unhandled exception at 0x01e9940d (OgreOggSound_d.dll) in RotM_d.exe:
0xC0000094: Integer division by zero.
The offending line (OgreOggStaticWavSound.cpp):
mBitsPerSample is 0.
Also note that I have installed the OpenAL redist and the SDK on this machine. I'm also using the Threaded version, with Boost.
And for reference, here is my code:
Hope this helps. If mBitsPerSample is not supposed to be 0, we should gaurd against it.
[Edit] As it turns out, I'm using some random .wav that I downloaded online (it plays in media player). When I tried to play the same wav I played on my laptop, everything worked fine.. [/Edit]
First off thanks for the library.
Last night I was playing sound on my laptop just fine. Today I tried on my tower at work, and the game crashes when trying to play a sound. I checked out OgreOggSound and built from source so I could provide some debug info, I hope it helps.
When the crash occurs I get the following message:
Unhandled exception at 0x01e9940d (OgreOggSound_d.dll) in RotM_d.exe:
0xC0000094: Integer division by zero.
The offending line (OgreOggStaticWavSound.cpp):
mPlayTime = ((mFormatData.mFormat->mLength-mAudioOffset) / ((mFormatData.mFormat->mBitsPerSample/8) * mFormatData.mFormat->mSamplesPerSec)) / mFormatData.mFormat->mChannels;mBitsPerSample is 0.
Also note that I have installed the OpenAL redist and the SDK on this machine. I'm also using the Threaded version, with Boost.
And for reference, here is my code:
std::string SoundManager::playAmbientSound(const std::string& fileName)
{
std::string name = "AutoNameGeneratedSound" + Ogre::StringConverter::toString(mAutoNameCounter++);
OgreOggSound::OgreOggISound* sound = mOgreOggSoundManager->createSound(name,fileName);
sound->play();
return name;
}
Hope this helps. If mBitsPerSample is not supposed to be 0, we should gaurd against it.
[Edit] As it turns out, I'm using some random .wav that I downloaded online (it plays in media player). When I tried to play the same wav I played on my laptop, everything worked fine.. [/Edit]