Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #12313

Re: Need audio feedback for spacebar press

From Dr J R Stockton <reply1209@merlyn.demon.co.uk>
Newsgroups comp.lang.javascript
Subject Re: Need audio feedback for spacebar press
Date 2012-02-29 19:42 +0000
Organization Home
Message-ID <T3BbkaIx+nTPFwvt@invalid.uk.co.demon.merlyn.invalid> (permalink)
References <jihhdm$7ar$1@dont-email.me> <inpok7lp9fkeaasp9m3k94pl9qaoom3lqv@4ax.com> <jiiqcc$cap$1@dont-email.me>

Show all headers | View raw


In comp.lang.javascript message <jiiqcc$cap$1@dont-email.me>, Tue, 28
Feb 2012 10:03:38, Cal Who <CalWhoNOSPAM@roadrunner.com> posted:

>>>What are my options?
>>
>>     One is:
>>
>> <script type="text/javascript">
>> function MakeSound(e)
>>  {
>>  if (e.which==32)
>>    alert("Space!");
>>  return true;
>>  }
>> </script>
>>
>> ...
>>
>> <input ... onkeypress="return MakeSound(event);">
>>
>
>won't that require the user to have to clink the alert OK to close the
>alert?

In my Opera, Safari, Chrome, an alert is silent.
In my MSIE8, Firefox, Opera, Safari, Chrome, pressing the space bar
removes the alert; so it is only necessary for the user to press the bar
twice.  But now there needs to be an audible test for that second space.



A local page could be an HTA using MSIE in Windows, in which case I'd
expect the API to include a noisemaker.



OTOH, Google found
<http://sapien.com/forums/scriptinganswers/forum_posts.asp?TID=4382>.

I get a sound (too much of it) by entering C:\Windows\Media\Ringin.wav
in the Firefox address bar,

in Opera, executing
   location.href = "file://localhost/C:/Windows/Media/Ringin.wav"
produces that sound.

Likewise in Firefox, Safari, Chrome, except that there you need to
return to the original page.

It works in IE8 too, but it also flashes up a sheep; however, the sheep
can be minimised, and the original page remains.

The file ding.wav might be preferred; or Windows XP Balloon.wav.

I dare say that effects will depend on browser and operating system, and
might be affected by an "upgrade".

<FAQENTRY> To make a warning sound.

-- 
 (c) John Stockton, Surrey, UK.  ?@merlyn.demon.co.uk   Turnpike v6.05   MIME.
   Web  <http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
 Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
 Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Neek audio feedback for spacebar press "Cal Who" <CalWhoNOSPAM@roadrunner.com> - 2012-02-27 22:24 -0500
  Re: Neek audio feedback for spacebar press Gene Wirchenko <genew@ocis.net> - 2012-02-27 21:38 -0800
    Re: Need audio feedback for spacebar press "Cal Who" <CalWhoNOSPAM@roadrunner.com> - 2012-02-28 10:03 -0500
      Re: Need audio feedback for spacebar press Gene Wirchenko <genew@ocis.net> - 2012-02-28 10:52 -0800
        Re: Need audio feedback for spacebar press "Cal Who" <CalWhoNOSPAM@roadrunner.com> - 2012-02-28 15:26 -0500
          Re: Need audio feedback for spacebar press Gene Wirchenko <genew@ocis.net> - 2012-02-28 12:53 -0800
      Re: Need audio feedback for spacebar press Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-02-28 20:13 +0100
      Re: Need audio feedback for spacebar press Dr J R Stockton <reply1209@merlyn.demon.co.uk> - 2012-02-29 19:42 +0000
        Re: Need audio feedback for spacebar press Andreas Bergmaier <andber93@web.de> - 2012-03-01 18:35 +0100
          Re: Need audio feedback for spacebar press Dr J R Stockton <jrs@merlyn.demon.co.uk> - 2012-03-02 21:48 +0000

csiph-web