# Playing a wav file in RoR

**URL:** <https://www.ruby-forum.com/t/playing-a-wav-file-in-ror/99709>\
**Category:** Rails\
**Created:** [July 25, 2006, 2:08am UTC](https://www.ruby-forum.com/t/playing-a-wav-file-in-ror/99709 "2006-07-25T02:08:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jim\_dandy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7ea924/32.png) [@jim\_dandy](https://www.ruby-forum.com/u/jim_dandy)\
**Post date:** [July 25, 2006, 2:08am UTC](https://www.ruby-forum.com/t/playing-a-wav-file-in-ror/99709/1 "2006-07-25T02:08:42Z")

</div>

Hi RoR Folks,

Have a MySQL database with a blob datytype with .wav files loaded into  
them. Would like to have a button on a form that toggles between play  
and pause when clicked and will play the .wav file.

Any suggestions on the best way to implement this?

Thanks!

---

<div class="post-metadata">

**Author:** ![jim\_dandy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7ea924/32.png) [@jim\_dandy](https://www.ruby-forum.com/u/jim_dandy)\
**Post date:** [July 25, 2006, 2:31am UTC](https://www.ruby-forum.com/t/playing-a-wav-file-in-ror/99709/2 "2006-07-25T02:31:33Z")

</div>

> Have a MySQL database with a blob datytype with .wav files loaded into  
> them. Would like to have a button on a form that toggles between play  
> and pause when clicked and will play the .wav file.
> 
> Any suggestions on the best way to implement this?

> **[Purchase Intent Data for Enterprise Tech Sales and Marketing | TechTarget](https://www.techtarget.com/)**
>
> Identify, influence and engage active buyers in your tech market with TechTarget's purchase intent insight-powered solutions. Activity matters.

---

<div class="post-metadata">

**Author:** ![jim\_dandy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7ea924/32.png) [@jim\_dandy](https://www.ruby-forum.com/u/jim_dandy)\
**Post date:** [July 25, 2006, 2:38am UTC](https://www.ruby-forum.com/t/playing-a-wav-file-in-ror/99709/3 "2006-07-25T02:38:01Z")

</div>

I believe from the server, you can just use sendfile.

This Flash player should load in the full file but only pause when  
the user wants, like how YouTube works.  
[http://www.1pixelout.net/code/audio-player-wordpress-plugin/](http://www.1pixelout.net/code/audio-player-wordpress-plugin/)  
[http://www.bloglines.com/about/news](http://www.bloglines.com/about/news)

You’ll need to see if it can do wav in addition to mp3.

```
        - dan

```

–  
Dan K. [mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://www.dankohn.com/](http://www.dankohn.com/)tel:+1-415-233-1000

---

<div class="post-metadata">

**Author:** ![jim\_dandy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7ea924/32.png) [@jim\_dandy](https://www.ruby-forum.com/u/jim_dandy)\
**Post date:** [July 25, 2006, 11:01pm UTC](https://www.ruby-forum.com/t/playing-a-wav-file-in-ror/99709/4 "2006-07-25T23:01:17Z")

</div>

Thanks for the excellent suggestions.

I’m still not clear how to have the source of a .wav file a blob column  
in a MySQL database table.

Any ideas?

Thanks Again for the help.

Dan W. wrote:

> > Have a MySQL database with a blob datytype with .wav files loaded into  
> > them. Would like to have a button on a form that toggles between play  
> > and pause when clicked and will play the .wav file.
> > 
> > Any suggestions on the best way to implement this?
> 
> [Purchase Intent Data for Enterprise Tech Sales and Marketing | TechTarget](http://ajaxian.com/archives/jssoundkit-super-easy-sound-api)

---

<div class="post-metadata">

**Author:** ![jim\_dandy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7ea924/32.png) [@jim\_dandy](https://www.ruby-forum.com/u/jim_dandy)\
**Post date:** [July 25, 2006, 3:06am UTC](https://www.ruby-forum.com/t/playing-a-wav-file-in-ror/99709/5 "2006-07-25T03:06:22Z")

</div>

YouTube uses flash as well.
