[Tutor] streaming audio

Marco marcolinux@linuxbr.com.br
Mon, 6 May 2002 14:39:24 -0300

Rob Brown-Bayliss (rob@zoism.org) wrote:

> 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.

>From the "Yes-I-know-my-english-sux" dept:

Probably this is not what you want but at least shows a very inefficient
way of doing it, the wrong way :)

Some days ago I was playing with my TV/radio board. I put it on my linux server
so that I could record shows without leaving my workstation turned on all night.

Then I thought: how can I listen the radio now? I need some way to
tranfer some bytes from server sound board to local sound board.
I remembered a litle program called netcat (nc). It's used for many
things like send requests for servers, very useful for debbuging cgi
scripts. Search  for it on google. Felt it would be just what I needed:

Did the following (server side):
$ cat /dev/dsp | nc -l -p 8081

(Grab bytes from /dev/dsp (sound board) and make them available at port

And (workstation side):
$ nc  my.server.adress 8081 >/dev/dsp
(Pull bytes from my.server.adress port 8081 and send them to my sound

And guess what? It worked :)
Then I stared at it for some minutes, thinking about the joy of having command
line tools and a unix shell.This things are really amazing, working with
linux for more then 4 years and still discovering new tricks.

Unfortunaly , having to get back to work I was forced to delay a project
of controlling a radio board from intranet with python.

BTW, does someone know how to do ioctl from python? The docs says some
things about fctnl but is too vague. We can always do it in C/swig but
it would be nice a pure python way.

Thanks for reading this far and I hope it helps.