Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1193
  • Last Modified:

audio alert: make a web page beep

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
joseph4
Asked:
joseph4
1 Solution
 
Kim RyanIT ConsultantCommented:
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
 
joseph4Author Commented:
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
 
Vahan YerkanianVirtualization Architect, DevOpsCommented:
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now