# Sound Library?

**URL:** <https://www.ruby-forum.com/t/sound-library/125202>\
**Category:** Ruby\
**Created:** [January 7, 2008, 1:41am UTC](https://www.ruby-forum.com/t/sound-library/125202 "2008-01-07T01:41:01Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![shea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@shea](https://www.ruby-forum.com/u/shea)\
**Post date:** [January 7, 2008, 1:41am UTC](https://www.ruby-forum.com/t/sound-library/125202/1 "2008-01-07T01:41:01Z")

</div>

I’m fairly new to Ruby and programming in general. I wanted to make a  
program using the BlinkenLights library(which I already have and know  
how to use) that would make the LEDs pulsate to the bass of the music. I  
already have a few other sound libraries but all they do is play sound  
and detect tags. Is there any libraries or anyway in code I could detect  
audio playing?

---

<div class="post-metadata">

**Author:** ![shea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@shea](https://www.ruby-forum.com/u/shea)\
**Post date:** [January 7, 2008, 2:57am UTC](https://www.ruby-forum.com/t/sound-library/125202/2 "2008-01-07T02:57:46Z")

</div>

On Jan 6, 2008, at 7:40 PM, Jono Oshea wrote:

> I’m fairly new to Ruby and programming in general. I wanted to make a  
> program using the BlinkenLights library(which I already have and know  
> how to use) that would make the LEDs pulsate to the bass of the  
> music. I  
> already have a few other sound libraries but all they do is play sound  
> and detect tags. Is there any libraries or anyway in code I could  
> detect  
> audio playing?

What library have you found that plays sound?

---

<div class="post-metadata">

**Author:** ![shea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@shea](https://www.ruby-forum.com/u/shea)\
**Post date:** [January 7, 2008, 4:10am UTC](https://www.ruby-forum.com/t/sound-library/125202/3 "2008-01-07T04:10:59Z")

</div>

> I’m fairly new to Ruby and programming in general. I wanted to make a  
> program using the BlinkenLights library(which I already have and know  
> how to use) that would make the LEDs pulsate to the bass of the music. I  
> already have a few other sound libraries but all they do is play sound  
> and detect tags. Is there any libraries or anyway in code I could detect  
> audio playing?

Wow, that’s a cool library. Are you talking about live audio? If  
you’re on OS X, you can probably call down to the CoreAudio APIs using  
either Ruby DL or RubyCocoa, but it won’t necessarily be a picnic.

–  
Giles B.

Podcast: [http://hollywoodgrit.blogspot.com](http://hollywoodgrit.blogspot.com)  
Blog: [http://gilesbowkett.blogspot.com](http://gilesbowkett.blogspot.com)  
Portfolio: [http://www.gilesgoatboy.org](http://www.gilesgoatboy.org)  
Tumblelog: [http://giles.tumblr.com](http://giles.tumblr.com)

---

<div class="post-metadata">

**Author:** ![shea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@shea](https://www.ruby-forum.com/u/shea)\
**Post date:** [January 7, 2008, 5:42am UTC](https://www.ruby-forum.com/t/sound-library/125202/4 "2008-01-07T05:42:12Z")

</div>

On Jan 6, 2008, at 6:40 PM, Jono Oshea wrote:

> 

You’ll probably need a C/C++/Obj-C library to do this fast enough to  
appear to be in sync.  
You might however simply consider looking into one of the game  
libraries.  
rubygame  
gosu  
etc…  
they don’t just do games,  
they do sound and animation and such well.

You might look at the C code for VLC player at [videolan.org](http://videolan.org)  
Pretty slick software, crossplatform, and includes some minimal audio  
visualizer/analyzer.

---

<div class="post-metadata">

**Author:** ![shea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@shea](https://www.ruby-forum.com/u/shea)\
**Post date:** [January 7, 2008, 7:08am UTC](https://www.ruby-forum.com/t/sound-library/125202/5 "2008-01-07T07:08:08Z")

</div>

Jono Oshea wrote:

> P.S.(To thefed) I was using the win32 sound library. I’m pretty sure it  
> comes with ruby if not its on ruby

Sorry somtimes I’m dumb and submit things before I’m down typing. It’s  
on rubyforge\*\*

---

<div class="post-metadata">

**Author:** ![shea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@shea](https://www.ruby-forum.com/u/shea)\
**Post date:** [January 7, 2008, 9:19pm UTC](https://www.ruby-forum.com/t/sound-library/125202/6 "2008-01-07T21:19:18Z")

</div>

On Jan 6, 2008, at 11:40 PM, John J. wrote:

> You’ll probably need a C/C++/Obj-C library to do this fast enough  
> to appear to be in sync.  
> You might however simply consider looking into one of the game  
> libraries.  
> rubygame  
> gosu  
> etc…  
> they don’t just do games,  
> they do sound and animation and such well.

I’m trying to use rubygame right now, but it keeps giving me a  
“warning: bad filetype” error for all my audio files.

---

<div class="post-metadata">

**Author:** ![shea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@shea](https://www.ruby-forum.com/u/shea)\
**Post date:** [January 8, 2008, 7:38am UTC](https://www.ruby-forum.com/t/sound-library/125202/7 "2008-01-08T07:38:39Z")

</div>

thefed wrote:

> On Jan 6, 2008, at 11:40 PM, John J. wrote:
> 
> > You’ll probably need a C/C++/Obj-C library to do this fast enough  
> > to appear to be in sync.  
> > You might however simply consider looking into one of the game  
> > libraries.  
> > rubygame  
> > gosu  
> > etc…  
> > they don’t just do games,  
> > they do sound and animation and such well.
> 
> I’m trying to use rubygame right now, but it keeps giving me a  
> “warning: bad filetype” error for all my audio files.

I can’t even install the gem. I tried through the repository and locally  
but I keep getting some error about it not being able to build native  
extensions or something?

---

<div class="post-metadata">

**Author:** ![shea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@shea](https://www.ruby-forum.com/u/shea)\
**Post date:** [January 8, 2008, 10:48pm UTC](https://www.ruby-forum.com/t/sound-library/125202/8 "2008-01-08T22:48:29Z")

</div>

On Jan 8, 2008, at 1:38 AM, Jono Oshea wrote:

> > > they don’t just do games,  
> > > they do sound and animation and such well.
> > 
> > I’m trying to use rubygame right now, but it keeps giving me a  
> > “warning: bad filetype” error for all my audio files.
> 
> I can’t even install the gem. I tried through the repository and  
> locally  
> but I keep getting some error about it not being able to build native  
> extensions or something?

You have to have like 3 libs installed. See the rubyforge page.

---

<div class="post-metadata">

**Author:** ![shea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@shea](https://www.ruby-forum.com/u/shea)\
**Post date:** [January 7, 2008, 7:06am UTC](https://www.ruby-forum.com/t/sound-library/125202/9 "2008-01-07T07:06:20Z")

</div>

John J. wrote:

> On Jan 6, 2008, at 6:40 PM, Jono Oshea wrote:
> 
> > 
> 
> You’ll probably need a C/C++/Obj-C library to do this fast enough to  
> appear to be in sync.  
> You might however simply consider looking into one of the game  
> libraries.  
> rubygame  
> gosu  
> etc…  
> they don’t just do games,  
> they do sound and animation and such well.
> 
> You might look at the C code for VLC player at [videolan.org](http://videolan.org)  
> Pretty slick software, crossplatform, and includes some minimal audio  
> visualizer/analyzer.

Thanks. I’ll look into all of that.

P.S.(To thefed) I was using the win32 sound library. I’m pretty sure it  
comes with ruby if not its on ruby
