streaming audio

brueckd at tbye.com brueckd at tbye.com
Mon May 6 18:29:11 EDT 2002


On 7 May 2002, Rob Brown-Bayliss wrote:

> On Tue, 2002-05-07 at 02:30, brueckd at tbye.com wrote:
> 
> > If possible, avoid actual streaming protocols as they are quite convoluted 
> > and proprietary. As long as the client end of the connection supports it 
> > and you have a fast enough connection (and you do since you're using a 
> > LAN), a simple progressive download is the way to go.
> 
> Yes, A simple download would work fine, and if thats all I wanted I
> would use XMMS or a similar app plugged into a decent amplifier.
> 
> But I want to be able to create "streams" on the server that can be
> connected to from any room, eg: a party stream and have all rooms
> playing the same sound in sync.

Unfortunately, even with a true audio stream they will all be a little out 
of sync no matter what you do (within reason); it's just a matter of how 
far out of sync is acceptable. I'm sure you can get really close with a 
software solution, but emitting a radio signal / running a cable will 
always be more in sync. ;-)

> So I belive I need some way of checking,I guess I could have all clients
> communicate with the server to make sure they start each song at the
> same time then just download from the server?

That might come close, but instead of syncing the play of the songs, you'd 
be syncing the request-buffer-and-then-play of the songs, so you still 
might end up with clients off by a second.

If you have/write a client plugin to your music player to receive
multicast packets that would be one approach (you're not going to have
reliability problems on a LAN unless you have other apps chewing up lots
of bandwidth). If you want to avoid client-side work then you can just
have your server round-robin send the latest "chunk" of audio data to each
HTTP connection and as connections are added they'll need a short file
header and then they too can just start playing whatever data comes across
the wire.

All this is great stuff if you're looking for an interesting project
that'll end up being useful, but if you're mostly interested in getting it
done then I'd imagine that there are some pre-built, non-Python, open
source solutions out there that'd be easier (heck, you could even get by
with any old LAN voice conferencing software that lets you crank the
quality up sufficiently high).

-Dave






More information about the Python-list mailing list