Connecting Tech Pros Worldwide Help | Site Map

Beep

Marcia Gulesian
Guest
 
Posts: n/a
#1: Jul 23 '05
How can I create a beep in javascript (I.E. 5.5 +) ?

kaeli
Guest
 
Posts: n/a
#2: Jul 23 '05

re: Beep


In article <407A92CA.4D96FB3F@theworld.com>, mg@theworld.com enlightened
us with...[color=blue]
> How can I create a beep in javascript (I.E. 5.5 +) ?
>
>[/color]

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

Jim Ley
Guest
 
Posts: n/a
#3: Jul 23 '05

re: Beep


On Mon, 12 Apr 2004 12:33:08 -0500, kaeli
<tiny_one@NOSPAM.comcast.net> wrote:
[color=blue]
>In article <407A92CA.4D96FB3F@theworld.com>, mg@theworld.com enlightened
>us with...[color=green]
>> How can I create a beep in javascript (I.E. 5.5 +) ?
>>
>>[/color]
>
>You can't.
>You'd need a sound file, like a .wav.[/color]

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/

Ivo
Guest
 
Posts: n/a
#4: Jul 23 '05

re: Beep


"Jim Ley" <jim@jibbering.com> wrote[color=blue]
> kaeli <tiny_one@NOSPAM.comcast.net> wrote:[color=green]
> > article <407A92CA.4D96FB3F@theworld.com>asked[color=darkred]
> >> How can I create a beep in javascript (I.E. 5.5 +) ?
> >>[/color]
> >
> >You can't.
> >You'd need a sound file, like a .wav.[/color]
>
> 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[/color]

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
[color=blue]
> 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/
>[/color]


Joakim Braun
Guest
 
Posts: n/a
#5: Jul 23 '05

re: Beep


"Ivo" <no@thank.you> skrev i meddelandet
news:407b4716$0$35389$18b6e80@news.wanadoo.nl...[color=blue]
> "Jim Ley" <jim@jibbering.com> wrote[color=green]
> > kaeli <tiny_one@NOSPAM.comcast.net> wrote:[color=darkred]
> > > article <407A92CA.4D96FB3F@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.[/color]
> >
> > 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[/color]
>
> 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[/color]

And that, obviously, works for Windows users only.

Joakim Braun


Richard Cornford
Guest
 
Posts: n/a
#6: Jul 23 '05

re: Beep


Joakim Braun wrote:[color=blue]
> "Ivo" <no@thank.you> skrev i meddelandet[/color]
<snip>[color=blue][color=green]
>> pointing to that local file: <bgsound
>> src="C:\WINDOWS\MEDIA\TADA.WAV" loop="1">[/color][/color]
<snip>[color=blue]
> And that, obviously, works for Windows users only.[/color]

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.


Jim Witte
Guest
 
Posts: n/a
#7: Jul 23 '05

re: Beep


>> How can I create a beep in javascript (I.E. 5.5 +) ?[color=blue]
>You can't.
>You'd need a sound file, like a .wav.[/color]

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
jswitte@bloomington.in.us
Dr John Stockton
Guest
 
Posts: n/a
#8: Jul 23 '05

re: Beep


JRS: In article <c5hj1v$31d$1@hood.uits.indiana.edu>, seen in
news:comp.lang.javascript, Jim Witte <jswitte@spam.bloomington.nospam.in
..spam.us> posted at Tue, 13 Apr 2004 20:37:19 :[color=blue][color=green][color=darkred]
>>> How can I create a beep in javascript (I.E. 5.5 +) ?[/color]
>>You can't.
>>You'd need a sound file, like a .wav.[/color]
>
> 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.[/color]

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.
Jim Ley
Guest
 
Posts: n/a
#9: Jul 23 '05

re: Beep


On Tue, 13 Apr 2004 03:46:57 +0200, "Ivo" <no@thank.you> wrote:
[color=blue]
>"Jim Ley" <jim@jibbering.com> wrote[color=green]
>> kaeli <tiny_one@NOSPAM.comcast.net> wrote:[color=darkred]
>> > article <407A92CA.4D96FB3F@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.[/color]
>>
>> 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[/color]
>
>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.[/color]

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/

Closed Thread


Similar JavaScript / Ajax / DHTML bytes