# Playing a sound with flash

**URL:** <https://www.ruby-forum.com/t/playing-a-sound-with-flash/182448>\
**Category:** Rails\
**Created:** [January 28, 2010, 8:54am UTC](https://www.ruby-forum.com/t/playing-a-sound-with-flash/182448 "2010-01-28T08:54:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hostep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a88e57/32.png) [@hostep](https://www.ruby-forum.com/u/hostep)\
**Post date:** [January 28, 2010, 8:54am UTC](https://www.ruby-forum.com/t/playing-a-sound-with-flash/182448/1 "2010-01-28T08:54:25Z")

</div>

Hi Guys

I am writing a chatlike application with Ruby on Rails. I have come  
across the problem that I need to subtly alert a user that a comment has  
been made in the case where the user has minimised the browser, or it is  
not in focus.

I am using Juggernaut to handle the posting back to the browser and it  
works fine (generally - have had some hiccups though - it hangs on  
Windows it seems). As Juggernaut requires the user to have flash  
installed I would think that the best way to get a beep playing would be  
to get flash to play the sound.

Unfortunately I dont have much (any, to be honest) experience with  
flash. Has anyone ever had a similar problem and solved it?

(It seems that most of the literature I found on playing sound with  
Rails recommends Apple’s Quicktime - as I am already requiring my users  
to have flash enabled for Juggernaut I’d like to avoid asking them to  
also install Quicktime)

You thoughts (and examples especially!) will be appreciated

Pieter H.  
South Africa

---

<div class="post-metadata">

**Author:** ![hostep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a88e57/32.png) [@hostep](https://www.ruby-forum.com/u/hostep)\
**Post date:** [January 28, 2010, 4:36pm UTC](https://www.ruby-forum.com/t/playing-a-sound-with-flash/182448/2 "2010-01-28T16:36:59Z")

</div>

On 28 Jan 2010, at 08:54, Pieter H. wrote:

> installed I would think that the best way to get a beep playing  
> also install Quicktime)
> 
> You thoughts (and examples especially!) will be appreciated

Since you are just sending back javascript code, you can use  
scriptaculous sound (or some other javascript sound library) to play a  
sound. No need to send it using flash, just load it as part of the  
javascript you’re initializing on the page. No need for Quicktime at  
all.

Best regards

Peter De Berdt
