Thread: OpenAL Programming

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    28

    OpenAL Programming

    I've recently been confused about a couple of things on OpenAL so I set out on a quest to clear them up.

    1. I was unsure about the structure of OpenAL which I now understand.
    2. I was unsure how to load audio data into memory or how audio works in general.

    This is where I'm stuck. Here's some code to help explain my meaning:

    Code:
    GEsound::GEsound(ALint numBuf = 1 )
    
    {
        ALCdevice *device = alcOpenDevice(NULL);
    
        if (device != NULL)
        {
            alGetError(); //Clears error state out.
            buffer[numBuf]; //buffer declared private as ALuint *
    
            alGenBuffers(numBuf, buffer);
    
            if (alGetError() == AL_NO_ERROR)
            {
                //What do I do to load data into the buffers?
            }
        }
    }
    The programmers guide explains to simply load PCM audio data into buffers using alBufferData. In the alBufferData function, it explains that you need to pass a void pointer to the audio data. I have not a clue where to begin to generate that pointer to be honest since I can't find many examples on audio programming or the theory behind it. I'm guessing this is where where I decode audio. Anyone care to help?

    EDIT: Buffer is an array to unsigned integers which hold names of the buffers. Not the actual buffers.
    Last edited by computerquip; 06-17-2009 at 10:03 PM. Reason: Cleaning up grammar and spelling.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OpenAL
    By skiler in forum C++ Programming
    Replies: 1
    Last Post: 01-26-2008, 09:18 AM
  2. OpenAL issues
    By Slyde in forum Game Programming
    Replies: 2
    Last Post: 03-20-2004, 09:33 AM
  3. OpenAL
    By Donnellg in forum Game Programming
    Replies: 11
    Last Post: 11-21-2002, 09:39 PM
  4. OpenAL
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 05-31-2002, 06:32 PM
  5. OpenAL
    By DavidP in forum Game Programming
    Replies: 0
    Last Post: 05-24-2002, 03:00 PM