[Openal] Open AL realtime 'streaming'

Jeremy Henry jeremy_h at hotmail.com
Mon Jun 26 09:32:32 PDT 2006


First of all you want to fill all of your buffers on the first pass.  Then 
you will need to frequently call an update function that will call 
alGetSourcei passing AL_BUFFERS_PROCESSED as the second param.
Then for every buffer processed you need to call alSourceUnqueueBuffers and 
unqueue one buffer at a time and then refill it before calling 
alSourceQueueBuffers to add them back in.  One of the earlier mistakes I 
made was in the general initialization code I was doing something I should 
not have been doing by calling alSourcei (theSound->alSource, AL_BUFFER, 
theBuffer->buffer[0]) this would afaik lock the buffer even before it was 
filled and I would get nothing but silence.  You don't want to do this at 
all because alSourceQueueBuffers basically does this for you.  If you need 
any more help I am sure my sample code is still up on the board I posted it 
on and I'll find the link.



From: dabeattie <dabeattie at qinetiq.com>
To: openal at opensource.creative.com
Subject: [Openal] Open AL realtime 'streaming'
Date: Mon, 26 Jun 2006 04:00:20 -0700 (PDT)


Hello,

I have audio data which I receive in real time 256bit chunks of ulaw data.
How do I play it back
N.B. silence isn't included so I don't have a constant stream

I realise that I need to convert the data to PCM but..

Do i use streaming or create a new buffer for each chunk?
The issue if I have a bunch of buffers and add the data using the buffers
processed there could be x amount of buffers to be processed before my the
new chunk gets a look in.

Anys tips or hints greatly appreciated.

Cheers,

David
--
View this message in context: 
http://www.nabble.com/Open-AL-realtime-%27streaming%27-1848216.html#a5044961
Sent from the OpenAL - User forum at Nabble.com.

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




More information about the Openal mailing list