Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System Beep

Status
Not open for further replies.

Bammy217

Programmer
Sep 28, 2002
74
BE
Hi All,

I have a dilemma, I need to perform the most horrible action one can think of I need to add a sound to a web-app...

So far I've tried various interactions all using ActiveX, JS, Flash and I'm down to using 8 different methods at the moment (Yes we even support IE on a MAC...) ... But there has to be a better way

Does anyone have any suggestions; here is my scenario:

We have created a web-app which allows remote workers to work from home, when they receive an e-mail in our AJAX (jQuery + JSON) driven web-mail the page plays a little beep to indicate that the web-mail has a new message.

When the boss changes your todo list, he has a button to make it "ping" on your computer at which point he expects you to call him within 5 minutes...

So far this is ofcourse the main reason we get complaints about the beep not working...

Anyway, is there someone out there that can show me a way to play a sound from JavaScript that will work on all machines / configurations; my users range from Linux to PC to Mac and every platform inbetween (smartphones etc...)

Any help would be greatly appreciated.

Many thanks,
d.

We never fail, we just find that the path to succes is never quite what we thought...
 
An embeded beep.wav is proably the best way. There is really no way out of making sure all of the employees have a plug-in on their client machine if it doesn't play a wave file out of the box.

Code:
<script> 
function PlaySound(soundObj) { 
  var sound = document.getElementById(soundObj); 
  sound.Play(); 
} 
</script> 
 
<embed src="success.wav" autostart="false" width="0" height="0" id="sound1" 
enablejavascript="true">

Call it:
Code:
PlaySound("sound1");

Credit:
Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top