Zeussy
02-13-2006, 09:41 PM
So, I've been busy, modifiy the tutorials around to make a OpenAL wrapper class.
I've been writing a renderer in Directx and linking objects to sources so I can update there position and stuff, but that isnt so much the problem.
I can't replay a sound once its been played, here is my little function:
void zSoundEngine::PlaySound( int Source )
{
//Check if sound is playing
int play;
alGetSourcei(g_Sources[Source], AL_SOURCE_STATE, &play);
if (play != AL_PLAYING)
{
// Play
alSourcePlay(g_Sources[Source]);
if ((error = alGetError()) != AL_NO_ERROR)
DisplayALError("alSourcePlay : ", error);
}
}
Now, it plays the sound once, then never again. But if I step through, it will repeat the sound. But only if I step through alSourcePlay.
Another thing I have noticed, i downloaded the Multiple sources Tut, and just ran the ExE, none of the sources replay in that, appart from the looping battlefield sound.
So I'm completely stumped, almost seems like a dodgy dll to me, but idk.
Any help will be appreciated.
I've been writing a renderer in Directx and linking objects to sources so I can update there position and stuff, but that isnt so much the problem.
I can't replay a sound once its been played, here is my little function:
void zSoundEngine::PlaySound( int Source )
{
//Check if sound is playing
int play;
alGetSourcei(g_Sources[Source], AL_SOURCE_STATE, &play);
if (play != AL_PLAYING)
{
// Play
alSourcePlay(g_Sources[Source]);
if ((error = alGetError()) != AL_NO_ERROR)
DisplayALError("alSourcePlay : ", error);
}
}
Now, it plays the sound once, then never again. But if I step through, it will repeat the sound. But only if I step through alSourcePlay.
Another thing I have noticed, i downloaded the Multiple sources Tut, and just ran the ExE, none of the sources replay in that, appart from the looping battlefield sound.
So I'm completely stumped, almost seems like a dodgy dll to me, but idk.
Any help will be appreciated.
