Beep

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marcia Gulesian

    #1

    Beep

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

  • kaeli

    #2
    Re: Beep

    In article <407A92CA.4D96F B3F@theworld.co m>, 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?



    Comment

    • Jim Ley

      #3
      Re: Beep

      On Mon, 12 Apr 2004 12:33:08 -0500, kaeli
      <tiny_one@NOSPA M.comcast.net> wrote:
      [color=blue]
      >In article <407A92CA.4D96F B3F@theworld.co m>, 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.



      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.javas cript FAQ - http://jibbering.com/faq/

      Comment

      • Ivo

        #4
        Re: Beep

        "Jim Ley" <jim@jibbering. com> wrote[color=blue]
        > kaeli <tiny_one@NOSPA M.comcast.net> wrote:[color=green]
        > > article <407A92CA.4D96F B3F@theworld.co m>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.javas cript FAQ - http://jibbering.com/faq/
        >[/color]


        Comment

        • Joakim Braun

          #5
          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@NOSPA M.comcast.net> wrote:[color=darkred]
          > > > article <407A92CA.4D96F B3F@theworld.co m>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


          Comment

          • Richard Cornford

            #6
            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.


            Comment

            • Jim Witte

              #7
              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@bloomin gton.in.us

              Comment

              • Dr John Stockton

                #8
                Re: Beep

                JRS: In article <c5hj1v$31d$1@h ood.uits.indian a.edu>, seen in
                news:comp.lang. javascript, Jim Witte <jswitte@spam.b loomington.nosp am.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.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
                <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

                Comment

                • Jim Ley

                  #9
                  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@NOSPA M.comcast.net> wrote:[color=darkred]
                  >> > article <407A92CA.4D96F B3F@theworld.co m>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.MeterLibr ary;
                  snd = m.SinSynth.Rate (800); // 800khz sine wave.
                  snd2=snd.RateAn im(m.Add(m.DANu mber(3),m.Cos(m .localTime)));
                  snd3=snd.RateAn im(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.solidColorIma ge(m.White);
                  DACtl.Start();
                  </SCRIPT>
                  </Body>

                  cheers,

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

                  Comment

                  Working...