Stream music to your Airport Express with Ruby!

Posted by – June 14, 2007

I just released raop-client which lets you stream music to your Airport Express with ruby.

Just install the gem:

gem install raop-client
[/sourcecode]

Here is a sample program which takes decoded input from stdin:

require 'raop-client'

raop = Net::RAOP::Client.new(ARGV[0])
raop.connect
raop.play $stdin
raop.disconnect

Just use the program like this:

% lame --decode -q some_song.mp3 - | ruby streamer.rb 192.168.1.173
[/sourcecode]

You'll have to supply your own mp3 and Airport Express IP address. Also, raop-client currently doesn't decode music, so you'll have to decode the music yourself.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>