streaming audio

Bill Tate tatebll at aol.com
Tue May 7 11:02:24 EDT 2002


Rob Brown-Bayliss <rob at zoism.org> wrote in message news:<mailman.1020652989.23833.python-list at python.org>...
> Hi, 
> 
> I am looking for some information on the basics of audio streaming, or
> any sort of data streaming really.
> 
> I want to create an app to stream audio around a LAN and really have
> know Idea on where to start.
> 
> Thanks in advance.

Some kindly suggestions.  You should, at the very least, be cautious
of an implementation that is based solely on a blocking IO model. 
Media streaming is a very IO intensive operation regardless of the
media format used.  It isn't an issue of microprocessor speed. 
Therefore, a media server based on a non-blocking IO model (using TCP
or possibly UDP sockets with select() or poll()functions) is likely to
yield much better performance.  You might want to check out Unix
Network Programming by W. Richard Stevens for more details - its very
well written.

A typical model used in network programming is to use one thread per
socket.   For you situation, you may wish to consider an alternative
to threads that is lighter-weight, can be instantiated quickly and
which can be stopped and restarted with ease.  If you will be
processing many client requests for different audio files, you might
check out the story behind the reincarnation of stackless (and
continuations in particular).  Continuations offer some advantages
well suited to media streaming.  They are extremely lightweight, can
be quickly instantiated, there is no "real" limit on their numbers,
they can be stopped and restarted with ease, and work extremely well
with sockets.  I can't speak to how the reinvented stackless works
with python 2.2 but others may have suggestions on other alternatives.
 At the very lest, its would be worth familarizing yourself with the
background on stackless and why it was created.

Good luck



More information about the Python-list mailing list