Hi!
I'm having problems playing static sounds in Linux because 'sometimes' the sounds don't play correctly (sounds rare). I'm trying to play 8 bits mono PCM WAVs files.
Steps (in quick):
- Init
- mpDevice = alcOpenDevice(0x0);
- mpContext = alcCreateContext(mpDevice, 0x0);
- alcMakeContextCurrent(mpContext)
- Generate a pool of 32 sources: looped -> alGenSources(1, &sourceID);
- Load all sounds
- Load sound files (with my own parser that works perfectly on windows) (5 files)
- After every load: (storing the bufferIDs associated with the filenames)
- alGenBuffers(1, &bufferID);
- alBufferData(bufferID, format, pBuffer, size, (int32) freq);
- GetSound
- Get free source
- Play (First time):
- alSourcei(pChannel->mSourceID, AL_BUFFER, mBufferID);
- alSourcef(pChannel->mSourceID, AL_PITCH, mPitch);
- alSourcef(pChannel->mSourceID, AL_GAIN, mGain);
- alSourcei(pChannel->mSourceID, AL_LOOPING, mLoop);
- alSourcePlay(pChannel->mSourceID);
- Exit:
- Delete source pool: looped -> alDeleteSources(1, &sourceID);
- Delete buffers created: looped -> alDeleteBuffers(1, &bufferID);
- alcMakeContextCurrent(0x0);
- alcDestroyContext(mpContext);
- alcCloseDevice(mpDevice);
Some idea??
I call alGetError every time I call an openAL function and I'm getting no errors :(
In windows all works perfectly. I'm lost now :(
_______________________________________________
Openal mailing list
Openal@...
http://opensource.creative.com/mailman/listinfo/openal