# Listen to streaming radio with ruby?

**URL:** <https://www.ruby-forum.com/t/listen-to-streaming-radio-with-ruby/191112>\
**Category:** Ruby\
**Created:** [July 5, 2010, 8:12pm UTC](https://www.ruby-forum.com/t/listen-to-streaming-radio-with-ruby/191112 "2010-07-05T20:12:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nickh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ea924/32.png) [@nickh](https://www.ruby-forum.com/u/nickh)\
**Post date:** [July 5, 2010, 8:12pm UTC](https://www.ruby-forum.com/t/listen-to-streaming-radio-with-ruby/191112/1 "2010-07-05T20:12:41Z")

</div>

Does anyone have any information they can share with me on reading an  
audio  
stream with ruby? I am teaching myself ruby and they say to find a  
project  
and build it, so here i am. I listen to a lot of online radio and i  
thought  
i would try and listen to an audio stream from ruby, if its possible.  
Thanks!  
~Nick

---

<div class="post-metadata">

**Author:** ![nickh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ea924/32.png) [@nickh](https://www.ruby-forum.com/u/nickh)\
**Post date:** [July 5, 2010, 9:20pm UTC](https://www.ruby-forum.com/t/listen-to-streaming-radio-with-ruby/191112/2 "2010-07-05T21:20:35Z")

</div>

On Jul 5, 8:11 pm, Nick H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> [Note: parts of this message were removed to make it a legal post.]
> 
> Does anyone have any information they can share with me on reading an audio  
> stream with ruby? I am teaching myself ruby and they say to find a project  
> and build it, so here i am. I listen to a lot of online radio and i thought  
> i would try and listen to an audio stream from ruby, if its possible.  
> Thanks!  
> ~Nick

Since I listen a lot of online radio stations I’ve made small GUI  
utility for myself. It downloads list of radio stations from Shoutcast  
and Xiph and on Linux uses any player (I use audacious2 on Ubuntu).  
You can see it on [GitHub - bosko/rstreamtuner: Ruby streaming media directory browser](http://github.com/bosko/rstreamtuner). You’ll need  
wxRuby in order to use it.

Regards,  
Bo¹ko Ivani¹evi

---

<div class="post-metadata">

**Author:** ![nickh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ea924/32.png) [@nickh](https://www.ruby-forum.com/u/nickh)\
**Post date:** [July 6, 2010, 12:07am UTC](https://www.ruby-forum.com/t/listen-to-streaming-radio-with-ruby/191112/3 "2010-07-06T00:07:30Z")

</div>

Nick H. wrote:

> Does anyone have any information they can share with me on reading an  
> audio  
> stream with ruby?

If you want to ‘catch’ the stream on its way in, I might try something  
like raw HTTP request:

[http://en.wikibooks.org/wiki/Ruby\_Programming/Reference/Objects/Socket#Example](http://en.wikibooks.org/wiki/Ruby_Programming/Reference/Objects/Socket#Example)

or use EventMachine to do the same, if you plan on having multiple  
connections open.  
GL.  
-r

---

<div class="post-metadata">

**Author:** ![nickh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ea924/32.png) [@nickh](https://www.ruby-forum.com/u/nickh)\
**Post date:** [July 13, 2010, 1:32pm UTC](https://www.ruby-forum.com/t/listen-to-streaming-radio-with-ruby/191112/4 "2010-07-13T13:32:44Z")

</div>

Nick H. wrote:

> Does anyone have any information they can share with me on reading an  
> audio stream with ruby? I am teaching myself ruby and they say to find a  
> project and build it, so here i am. I listen to a lot of online radio and i  
> thought i would try and listen to an audio stream from ruby, if its possible.  
> Thanks!  
> ~Nick

Hi Nick, a very simplistic maybe =\> invoke a system command to run VLC,  
passing it the url of the radio stream; like:

system “vlc [http://radio1.internode.on.net:8000/117](http://radio1.internode.on.net:8000/117) vlc://quit ;”

rob
