469,951 Members | 2,717 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,951 developers. It's quick & easy.

Beep

How can I create a beep in javascript (I.E. 5.5 +) ?

Jul 23 '05 #1
8 8907
In article <40***************@theworld.com>, mg@theworld.com enlightened
us with...
How can I create a beep in javascript (I.E. 5.5 +) ?


You can't.
You'd need a sound file, like a .wav.

--
--
~kaeli~
Can you be a closet claustrophobic?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2
On Mon, 12 Apr 2004 12:33:08 -0500, kaeli
<ti******@NOSPAM.comcast.net> wrote:
In article <40***************@theworld.com>, mg@theworld.com enlightened
us with...
How can I create a beep in javascript (I.E. 5.5 +) ?


You can't.
You'd need a sound file, like a .wav.


Well if you're willing to limit yourself to IE, you can actually
create sounds without any external files, or non-default installed
tech.

http://jibbering.com/directanimation/sound.html

Of course I wouldn't recommend it, the pointless activeX warnings
under higher security would be too much of a turn off, even as an
optional with it wrapped up in a suitable degradeable manner.

Jim.

--
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 23 '05 #3
Ivo
"Jim Ley" <ji*@jibbering.com> wrote
kaeli <ti******@NOSPAM.comcast.net> wrote:
article <40***************@theworld.com>asked
How can I create a beep in javascript (I.E. 5.5 +) ?

You can't.
You'd need a sound file, like a .wav.


Well if you're willing to limit yourself to IE, you can actually
create sounds without any external files, or non-default installed
tech.

http://jibbering.com/directanimation/sound.html


Using IE6, I am greeted with an error on that page: "'DACtl' is undefined"
on line 4. This is reported in the usual alert box with my usual alert
sound. There you go.
Another idea, if you 're willing to limit yourself to those users who have
the default sound files in their default places on their own harddisks, is
to include a simple <bgsound/embed/object> pointing to that local file:
<bgsound src="C:\WINDOWS\MEDIA\TADA.WAV" loop="1">
HTH
Ivo
Of course I wouldn't recommend it, the pointless activeX warnings
under higher security would be too much of a turn off, even as an
optional with it wrapped up in a suitable degradeable manner.

Jim.

--
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 23 '05 #4
"Ivo" <no@thank.you> skrev i meddelandet
news:40**********************@news.wanadoo.nl...
"Jim Ley" <ji*@jibbering.com> wrote
kaeli <ti******@NOSPAM.comcast.net> wrote:
article <40***************@theworld.com>asked
> How can I create a beep in javascript (I.E. 5.5 +) ?
>

You can't.
You'd need a sound file, like a .wav.


Well if you're willing to limit yourself to IE, you can actually
create sounds without any external files, or non-default installed
tech.

http://jibbering.com/directanimation/sound.html


Using IE6, I am greeted with an error on that page: "'DACtl' is undefined"
on line 4. This is reported in the usual alert box with my usual alert
sound. There you go.
Another idea, if you 're willing to limit yourself to those users who have
the default sound files in their default places on their own harddisks, is
to include a simple <bgsound/embed/object> pointing to that local file:
<bgsound src="C:\WINDOWS\MEDIA\TADA.WAV" loop="1">
HTH
Ivo


And that, obviously, works for Windows users only.

Joakim Braun
Jul 23 '05 #5
Joakim Braun wrote:
"Ivo" <no@thank.you> skrev i meddelandet <snip>
pointing to that local file: <bgsound
src="C:\WINDOWS\MEDIA\TADA.WAV" loop="1">

<snip> And that, obviously, works for Windows users only.


And not even all of them as NT based Windows OSs don't have a "WINDOWS"
directory, and it is not necessary that Windows is run form the C:
drive.

Richard.
Jul 23 '05 #6
>> How can I create a beep in javascript (I.E. 5.5 +) ?
You can't.
You'd need a sound file, like a .wav.


Since most, if not all OS's have some system-wise beep routine, anybody
have an idea how I get this "in" as something that should be included in
the next revision of the JS Spec - a simple command 'beep;' (perhaps with
parameter(s) indicating length and/or volume)

This would make JS more OS independent (as long as IE didn't screw it
up..), but it would also mean that the beeps would respect the user's
preferences for beep sound and volume.

Jim Witte
js*****@bloomington.in.us
Jul 23 '05 #7
JRS: In article <c5**********@hood.uits.indiana.edu>, seen in
news:comp.lang.javascript, Jim Witte <js*****@spam.bloomington.nospam.in
..spam.us> posted at Tue, 13 Apr 2004 20:37:19 :
How can I create a beep in javascript (I.E. 5.5 +) ?

You can't.
You'd need a sound file, like a .wav.


Since most, if not all OS's have some system-wise beep routine, anybody
have an idea how I get this "in" as something that should be included in
the next revision of the JS Spec - a simple command 'beep;' (perhaps with
parameter(s) indicating length and/or volume)

This would make JS more OS independent (as long as IE didn't screw it
up..), but it would also mean that the beeps would respect the user's
preferences for beep sound and volume.


Beeps go through the speakers. I keep my speakers turned off, except
when I specifically want to use them for music.

Therefore you will need something like

function Beep(X, Y) {
alert("Please ensure that the speakers are on.")
SysBeep(X, Y)
alert ("Thank you; you can turn them off now.") }
or
function Beep() { alert('Please say "beep".') }

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 23 '05 #8
On Tue, 13 Apr 2004 03:46:57 +0200, "Ivo" <no@thank.you> wrote:
"Jim Ley" <ji*@jibbering.com> wrote
kaeli <ti******@NOSPAM.comcast.net> wrote:
> article <40***************@theworld.com>asked
>> How can I create a beep in javascript (I.E. 5.5 +) ?
>>
>
>You can't.
>You'd need a sound file, like a .wav.


Well if you're willing to limit yourself to IE, you can actually
create sounds without any external files, or non-default installed
tech.

http://jibbering.com/directanimation/sound.html


Using IE6, I am greeted with an error on that page: "'DACtl' is undefined"
on line 4. This is reported in the usual alert box with my usual alert
sound. There you go.


Sorry, it seemed to have got screwed up at some point:

<BODY>
<OBJECT id=DACtl CLASSID="CLSID:B6FFC24C-7E13-11D0-9B47-00C04FC2F51D"
style="height:1;width:1;top:0;left:0;"></OBJECT>
<SCRIPT>
m = DACtl.MeterLibrary;
snd = m.SinSynth.Rate(800); // 800khz sine wave.
snd2=snd.RateAnim(m.Add(m.DANumber(3),m.Cos(m.loca lTime)));
snd3=snd.RateAnim(m.Div(m.Sin(m.localTime),m.Cos(m .localTime)));
DACtl.Sound = snd3;
// change snd to snd2 and snd3 for more interesting sounds.
DACtl.image = m.solidColorImage(m.White);
DACtl.Start();
</SCRIPT>
</Body>

cheers,

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 23 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Leo | last post: by
3 posts views Thread by #Hai | last post: by
19 posts views Thread by Anon Email | last post: by
2 posts views Thread by Hai Ly Hoang | last post: by
4 posts views Thread by Kartic | last post: by
4 posts views Thread by adi | last post: by
4 posts views Thread by =?Utf-8?B?UmljaA==?= | last post: by
5 posts views Thread by =?Utf-8?B?UmFmYWVs?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.