[Openal] Problem with OpenAL in Linux

darky lucera c.listas at gmail.com
Fri Sep 11 06:23:08 PDT 2009


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 :(
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://opensource.creative.com/pipermail/openal/attachments/20090911/d7fa1965/attachment.html


More information about the Openal mailing list