Another method of streaming audio via iTunes
Nov 13, '06 07:30:02AM
Contributed by: VAleks
Looking through various hints (like this one, or on the icecast mailing list) about making your own streaming station with iTunes, I wanted something relatively simple. I just wanted to route all sounds coming from my Mac to a UNIX system (Solaris, in my case), and something like icecast was far more powerful than what I needed. I decided to make it UNIX way with maximum offload of a task to my Solaris box.
Preparation for solution is quite simple:
- Get and install Soundflower -– this is the key component that'll allow routing of all sounds elsewhere.
- Either from Fink or with DarwinPorts (now known as MacPorts) install EsounD package (we'll need the only esdrec utility from there, in fact)
- On UNIX box prepare: netcat, lame, and any MP3 player (I use mplayer).
To actually stream do the following:
- Use Soundflower (2ch) as default input and output device on the Mac.
- On UNIX box, start the following: nc -l -p 2048 | lame -b 128 - - | mplayer -nocache - (change 2048 to any other port you want to use; -nocache was added to mplayer startup because on a Solaris box I have caching turned on by default). This will order netcat to listen on given port then pipe data through the MP3 encoder to a MP3 player.
- On OS X type in Terminal: esdrec | nc hostname 2048 (modify hostname to match yours, same goes for port).
This idea is far more simple and gives a degree of possibility to put encoding where you want, but is less useful when you want to stream to several hosts at once (something you can do with icecast). If you prefer a more OS X-styled solution, you can play with MuSE and icecast, but the major drawback of such solutions is caching of stream everywhere so that sound will be delayed for several seconds.
Comments (6)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20061106042701610