Problem with OpenAL in Linux

View: New views
2 Messages — Rating Filter:   Alert me  

Problem with OpenAL in Linux

by darky lucera :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

Re: Problem with OpenAL in Linux

by Chris Robinson-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Friday 11 September 2009 6:23:08 am darky lucera wrote:
> 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.

Hi.

What version of OpenAL are you using? In what way doesn't it sound correct?
And does the problem only show up with specific sounds, or any/all?

>From what you've pasted, I don't see anything immediately wrong. But it would
be helpful if you can make a small app that has the same problem, or show more
code.

_______________________________________________
Openal mailing list
Openal@...
http://opensource.creative.com/mailman/listinfo/openal