Looping sounds and loop offset

chaosavy

26-09-2012 02:15:53

I can't get the loop offset paramater to work with looping sounds, but it doesn't want to work for me...arrgh!!!


Here's my code:


if(soundFile.empty())
return NULL;

OgreOggSound::OgreOggSoundManager* mSoundManager = OgreOggSound::OgreOggSoundManager::getSingletonPtr();

bool bStream = false;

if(bLoop && loopOffset > 0)
bStream = true; //Have to set streaming sound for loop offset sounds

OgreOggSound::OgreOggISound* sound = mSoundManager->createSound(nameAppend + name, soundFile, bStream, bLoop, true, worldFactory->mSceneMgr) ;
if(bLoop)
sound->setLoopOffset(loopOffset);


sound->setSoundType(OgreOggSound::SOUND_TYPE::S_FX);
Common::setQueryFlagsNoHit(sound);
sound->setMaxDistance(75.0f);
sound->setReferenceDistance(60.0f);

nodeToAttachTo->attachObject(sound);




any ideas? The sound does (its a .wav in case that makes a difference) indeed loop, but doesn't start at the loop offset.

I've debugged the code to make sure that the bLoop, bStream and the offset float are set properly.

thanks for any help