samme
13-08-2012 06:01:54
Actually I have followed some examples to create the sound and play, it seems very straight forward:
However, after a certain number of sounds played (actually it is the max. number of sound defined in init()), non-positional sound will never be heard!
It is due to no sound created has "stopped" manually. After all sound sources has been used up, it will search for stopped sound to reuse. Since I have never call ->stop(), non of sound can be reused! Priority check will also fail, until playing positional sound will work in the last "distance" check.
What will be the correct way to play? Should I missed something to let the oggsound to stop automatically?
Or it is a bug to check mPlay in "isStopped" function call? (state is AL_STOPPED but mPlay is TRUE)
OgreOggSound::OgreOggISound* sound;
if ( sound = OgreOggSound::OgreOggSoundManager::getSingleton().createSound(name, filename, false/*streamed*/, loop))
{
sound->disable3D(true);
if (!loop)
sound->markTemporary();
sound->play();
However, after a certain number of sounds played (actually it is the max. number of sound defined in init()), non-positional sound will never be heard!
It is due to no sound created has "stopped" manually. After all sound sources has been used up, it will search for stopped sound to reuse. Since I have never call ->stop(), non of sound can be reused! Priority check will also fail, until playing positional sound will work in the last "distance" check.
What will be the correct way to play? Should I missed something to let the oggsound to stop automatically?
Or it is a bug to check mPlay in "isStopped" function call? (state is AL_STOPPED but mPlay is TRUE)
/*/////////////////////////////////////////////////////////////////*/
bool OgreOggISound::isStopped() const
{
if(mSource != AL_NONE)
{
ALenum state;
alGetError();
alGetSourcei(mSource, AL_SOURCE_STATE, &state);
return (!mPlay && (state != AL_PLAYING));
}
return false;
}