streaming from file

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

streaming from file

by _angelo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

i need a little suggestion on how to implement a streaming sender,
reding audio from file.
Actually, i used "alut" to load the file in memory, but then, to stream
it over the network, the timing seems not perfect.

When i capture, the send timing is correct (remote side play the sound
correctly).
Is someway possible to simulate the AL capture, so that i can  have an
exact timing for the file network send ?

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

Parent Message unknown Re: streaming from file

by _angelo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Jason,

i did it quite acceptable for now, i send 3 packets of 1024 bytes  for
remote buffering, then i send one packet every 64msec (8000khz 16bit
mono) and the stream seems to be played correctly, always.

many thanks,
Angelo

Jason Daly ha scritto:

> gmail wrote:
>> Hi all,
>>
>> i need a little suggestion on how to implement a streaming sender,
>> reding audio from file.
>> Actually, i used "alut" to load the file in memory, but then, to
>> stream it over the network, the timing seems not perfect.
>>  
>
> This is one of those things that's really hard to get just right.  The
> simple solution is to buffer a bit on the receiving side before sending
> it to output (this is called jitter buffering).  This will introduce
> some latency (delay), but you have to have at least a fraction of a
> second buffered to keep the stream stable.  Start with a 0.1-0.2 second
> buffer, and once you get that stable, you can reduce the buffer size to
> bring the latency back down.
>
> Another thing that I've found critical is to use a separate thread to
> read from the network, especially if you're using a UDP connection.
> Otherwise, you're much more likely to lose packets, and hence, lose
> audio.  Create a thread that does nothing but read from the network and
> store the data in a queue.  Then, your main thread can pick up the
> queued data whenever it gets time.
>
> Expect to do a lot of tweaking on this.  It's one of those things you
> can play with for a long time before you're happy with it.
>
> --"J"
>

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

Re: streaming from file

by Jason Daly :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

gmail wrote:
> Thanks Jason,
>
> i did it quite acceptable for now, i send 3 packets of 1024 bytes  for
> remote buffering, then i send one packet every 64msec (8000khz 16bit
> mono) and the stream seems to be played correctly, always.
>  

Glad you got it working!

--"J"

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