Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Another method of streaming audio via iTunes Network
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.
    •    
  • Currently 3.75 / 5
  You rated: 4 / 5 (4 votes cast)
 
[27,601 views]  

Another method of streaming audio via iTunes | 6 comments | Create New Account
Click here to return to the 'Another method of streaming audio via iTunes' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Another method of streaming audio via iTunes
Authored by: lras on Nov 13, '06 09:07:39AM
nc is neat, thanks for the hint! But doesn't it make more sense to compress the audio on the Mac, before sending it across the network? mplayer can play many different formats, so you don't need to turn the raw wav data into mp3 for mplayer to play it.

[ Reply to This | # ]
Another method of streaming audio via iTunes
Authored by: VAleks on Nov 13, '06 10:23:06AM
The bandwidth on local LAN was not a question – I'm the single user here. When I was using lame on the local end it constantly consumed 20% CPU, while CPU on Solaris box was also not a question – it's a file server with a sound card.

[ Reply to This | # ]
Another method of streaming audio via iTunes
Authored by: fracai on Nov 13, '06 09:48:44AM

you could stream to multiple hosts (at least in a small network) by sending to a multicast group over udp.

you might save some time by encoding the output of esd to mp3 before you broadcast, but encoding on the receiving end is pretty useless.

---
i am jack's amusing sig file



[ Reply to This | # ]
Another method of streaming audio via iTunes
Authored by: fracai on Nov 13, '06 09:51:27AM

you might save some bandwidth
saving time only if you benefit from the tradeoff of less bandwidth and more cpu time.

---
i am jack's amusing sig file



[ Reply to This | # ]
Another method of streaming audio via iTunes
Authored by: VAleks on Nov 13, '06 10:40:53AM

Hmm... Haven't thought of using it as multicast streamer. May be because there is only one consumer?



[ Reply to This | # ]
hardware solution?
Authored by: rexroof on Nov 15, '06 07:56:11AM

Anyone know of another bit of (perhaps cheaper) hardware that will show up as a remote speaker similar to the airport express? or perhaps a unix app that will emulate this?



[ Reply to This | # ]