Solved

audio alert: make a web page beep

Posted on 2001-09-10
3
1,183 Views
Last Modified: 2010-08-05
i would have thought this was easy, but it just doesn't want to work for me. i have an on-the-fly web page that refreshes itself automatically, but *only* if there's new info to be shown. since a user might have several open browsers i want the page to cause a windows beep when it loads. this way, when it refreshes with new data, the user is alerted to check it.

i've tried stuff like:
print chr(7);
print qq~<Win32::Sound::Play("SystemExclamation")>~;
print "\a";
print "\007";

i'm running perl 5 on a unix box. any suggestions?
0
Comment
Question by:joseph4
3 Comments
 
LVL 19

Expert Comment

by:Kim Ryan
ID: 6472588
Keep in mind that HTML is independant of  opeasting systems, so calls to Windows functions seem out of place. You could try the bgsound tag. This will paly a sound on loading and user refresh, not sure about an auto refresh.

<bgsound src="/windows/media/chord.wav">

Another alternative is the <object> tag to embed a sound
0
 

Author Comment

by:joseph4
ID: 6472879
thanks, teraplane,

i'll try the <bgsound src="/windows/media/chord.wav">, but i don't want to embed and cause the browser to launch winamp or whatever
0
 
LVL 1

Accepted Solution

by:
vahan earned 100 total points
ID: 6481538
Note that bgsound works only on IE, it wont work on other browsers.
Your best choice is embedding the sound through a flash movie clip,
as flash player is integrated into most of the modern browsers, and
this way you won't have winamp or other alike program launched each
time you want the sound.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question