Forum Moderators: open

Message Too Old, No Replies

<bing>

Any way to make a simple sound?

         

ggrot

12:39 am on Jun 28, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm looking for a way to get the browser to make a sound on a certain event. The event is javascript driven, but on that event, a new html page loads - so the sound could be embedded in that HTML page just as easily. Any sound will do, I just want some type of audible feedback that this particular event has just happened. A beep or a bing or something (not a click).

I know I could use embed or put a small flash applet on the page that delivers the sound, but I was looking for something simpler. Perhaps a built in sound that I could call w/ javascript or HTML(since I'm not picky on the sound itself). I doubt such a thing exists, but I thought I'd ask anyway.

Purple Martin

1:01 am on Jun 28, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The embed tag should do it. Just copy the sound file from your machine's Media folder (assuming PC) to your web page's folder.

<embed src="bing.wav"></embed>

To avoid seeing the control panel (play/pause button etc) you could put the embed tag in a hidden or off-screen div.

ggrot

1:27 am on Jun 28, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I know. I was just wondering if there was anything simpler that would load faster (ie: not a separate file).

caine

1:43 am on Jun 28, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



emdedded music via javascript Onload, is one thing.

an onClick function must be what you are looking for. though i don't have any scripts to hand for this, i would suggest drilling into this forum, as their have been a few Javascript resource threads, that have many, maybe there is one that covers this.

Purple Martin

1:46 am on Jun 28, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just a thought - is it possible to preload the .wav while the user is reading the first page, in a similar way to preloading images? I haven't tried it but I imagine it would work.

caine

3:34 am on Jun 28, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



yes that is the onLoad function, which will load up the file, will the page is downloading.

rewboss

7:28 am on Jun 28, 2002 (gmt 0)

10+ Year Member



Out of curiosity, why is it so important to provide audio feedback if a new page loads anyway?

chiyo

10:42 am on Jun 28, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ah.. what you really need is a machine that goes "ping"..