[Openal] Streaming PCM data to buffers

Katharina Garbe katharina.garbe at fit.fraunhofer.de
Thu Aug 16 01:56:17 PDT 2007


Hi everybody!

 

I have some questions on writing PCM data to an OpenAL Buffer.

 

Recently, I am working on a project/application where I receive PCM data
(provided by DirectShow) of a sample split in fragments from a callback
function. So far, I receive these fragments continually, which means after
the last fragment of the sample has arrived, the first fragment comes again.

 

Which is the best way ('best practice') to write a data stream to an OpenAL
Buffer:

 

- continually stream the fragments into several buffers and play them over
and over again

- stream the fragments until the end of the sample into several buffers an
play those in a queue

- stream the fragments until the end of the sample into one buffer only

 

During my application there will be different sounds which will all use this
callback function. So, the length of the sample might vary. If you suggest I
should use the first or second way, it might be useful for me to know how
many buffers I should use (an amount of static buffers or a varying amount
of buffers depending on the length of the sample). 

 

More over, I'd like to know about your preferred API/framework for creating
a PCM stream out of several audio file formats. As far as I understand, the
alutLoadWAVFile() only supports .wav files. Now, if I want to stream other
audio files (like OGG, MP3, MIDI etc.) to PCM data is SDL (www.libsdl.org)
the most adequate solution? Or are there other cross-platform libraries you
prefer?

 

Looking forward to hear from you,

 

Katharina

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://opensource.creative.com/pipermail/openal/attachments/20070816/afccb4f2/attachment.html


More information about the Openal mailing list