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


Groups > comp.lang.javascript > #12224 > unrolled thread

Neek audio feedback for spacebar press

Started by"Cal Who" <CalWhoNOSPAM@roadrunner.com>
First post2012-02-27 22:24 -0500
Last post2012-03-02 21:48 +0000
Articles 10 — 6 participants

Back to article view | Back to comp.lang.javascript


Contents

  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

#12224 — Neek audio feedback for spacebar press

From"Cal Who" <CalWhoNOSPAM@roadrunner.com>
Date2012-02-27 22:24 -0500
SubjectNeek audio feedback for spacebar press
Message-ID<jihhdm$7ar$1@dont-email.me>
I have a situation where someone will not be looking at the laptop and will 
reach over and hit the spacebar.

It is important that he know that he indeed did correctly hit the spacebar 
without examining the screen.

The file is not from a website. Rather it is an HTML file on the laptop.

A simple sound would be good but googling leaves me without a simple 
solution.

The sound that alert makes would do well.

I would like very much to need only one file (i.e., the HTML) but will do 
whatever it takes.

What are my options?



[toc] | [next] | [standalone]


#12227

FromGene Wirchenko <genew@ocis.net>
Date2012-02-27 21:38 -0800
Message-ID<inpok7lp9fkeaasp9m3k94pl9qaoom3lqv@4ax.com>
In reply to#12224
On Mon, 27 Feb 2012 22:24:36 -0500, "Cal Who"
<CalWhoNOSPAM@roadrunner.com> wrote:

>I have a situation where someone will not be looking at the laptop and will 
>reach over and hit the spacebar.
>
>It is important that he know that he indeed did correctly hit the spacebar 
>without examining the screen.
>
>The file is not from a website. Rather it is an HTML file on the laptop.
>
>A simple sound would be good but googling leaves me without a simple 
>solution.
>
>The sound that alert makes would do well.

     So have it be alert().

>I would like very much to need only one file (i.e., the HTML) but will do 
>whatever it takes.
>
>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);">

     Interesting that I am wrestling with onkey* right now.  That
means if I got it wrong here, someone will correct me, and we will
both learn.  How economical.  If I got it right, I get just a bit more
cred.  Of course, I have probably blown that by posting this
paragraph.

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#12231 — Re: Need audio feedback for spacebar press

From"Cal Who" <CalWhoNOSPAM@roadrunner.com>
Date2012-02-28 10:03 -0500
SubjectRe: Need audio feedback for spacebar press
Message-ID<jiiqcc$cap$1@dont-email.me>
In reply to#12227
>>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?

Thanks 

[toc] | [prev] | [next] | [standalone]


#12249 — Re: Need audio feedback for spacebar press

FromGene Wirchenko <genew@ocis.net>
Date2012-02-28 10:52 -0800
SubjectRe: Need audio feedback for spacebar press
Message-ID<oh8qk7h99npuete1srqp04usfojnjmn1m8@4ax.com>
In reply to#12231
On Tue, 28 Feb 2012 10:03:38 -0500, "Cal Who"
<CalWhoNOSPAM@roadrunner.com> wrote:

>>>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?

     Yes.  If I knew what exactly you are trying to do, it might be
easier to come up with something more elegant.

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#12253 — Re: Need audio feedback for spacebar press

From"Cal Who" <CalWhoNOSPAM@roadrunner.com>
Date2012-02-28 15:26 -0500
SubjectRe: Need audio feedback for spacebar press
Message-ID<jijda9$6pd$1@dont-email.me>
In reply to#12249
"Gene Wirchenko" <genew@ocis.net> wrote in message 
news:oh8qk7h99npuete1srqp04usfojnjmn1m8@4ax.com...
> On Tue, 28 Feb 2012 10:03:38 -0500, "Cal Who"
> <CalWhoNOSPAM@roadrunner.com> wrote:
>
>>>>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?
>
>     Yes.  If I knew what exactly you are trying to do, it might be
> easier to come up with something more elegant.
>
> Sincerely,
>
> Gene Wirchenko

This is probably a good summary:
It is important that he know that he indeed did correctly hit the spacebar
without examining the screen.

Thanks



[toc] | [prev] | [next] | [standalone]


#12255 — Re: Need audio feedback for spacebar press

FromGene Wirchenko <genew@ocis.net>
Date2012-02-28 12:53 -0800
SubjectRe: Need audio feedback for spacebar press
Message-ID<d8fqk7lal6hn80sa5gelltkg53nspa3708@4ax.com>
In reply to#12253
On Tue, 28 Feb 2012 15:26:47 -0500, "Cal Who"
<CalWhoNOSPAM@roadrunner.com> wrote:

[snip]

>This is probably a good summary:
>It is important that he know that he indeed did correctly hit the spacebar
>without examining the screen.

     Well, no.  You have an unusual requirement.  Why is it even a
requirement?  There may be other ways to solve the underlying problem
if only we knew what the problem is that needs to be solved.

     For example: If the person is blind, that will probably lead to a
different solution than if he is not.

     You have gone into too much detail on what is supposeed to be
done.  For example: What is the significance of the spacebar, and
could it be <Enter> instead that is pressed?

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#12251 — Re: Need audio feedback for spacebar press

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2012-02-28 20:13 +0100
SubjectRe: Need audio feedback for spacebar press
Message-ID<1945976.aqSPkdTlGX@PointedEars.de>
In reply to#12231
[Posted & mailed]

Cal Who wrote:

>>>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?

Yes, it won't.

Please leave in the attribution lines.  Even an attribution novel is better 
than no attribution at all.


PointedEars
-- 
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
  -- from <http://www.vortex-webdesign.com/help/hidesource.htm> (404-comp.)

[toc] | [prev] | [next] | [standalone]


#12313 — Re: Need audio feedback for spacebar press

FromDr J R Stockton <reply1209@merlyn.demon.co.uk>
Date2012-02-29 19:42 +0000
SubjectRe: Need audio feedback for spacebar press
Message-ID<T3BbkaIx+nTPFwvt@invalid.uk.co.demon.merlyn.invalid>
In reply to#12231
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)

[toc] | [prev] | [next] | [standalone]


#12325 — Re: Need audio feedback for spacebar press

FromAndreas Bergmaier <andber93@web.de>
Date2012-03-01 18:35 +0100
SubjectRe: Need audio feedback for spacebar press
Message-ID<jiobvv$i1t$1@news.albasani.net>
In reply to#12313
Dr J R Stockton schrieb:

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

So, is there any?

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

But that solution won't give you a volume control, will it? A HTML5 
audio element would have that feature.

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

I can't hear anything at Windows/Media/ding.wav, but 
Windows/Media/<theme>/Windows%20Ding.wav might be a good choice.

  Bergi

[toc] | [prev] | [next] | [standalone]


#12351 — Re: Need audio feedback for spacebar press

FromDr J R Stockton <jrs@merlyn.demon.co.uk>
Date2012-03-02 21:48 +0000
SubjectRe: Need audio feedback for spacebar press
Message-ID<93vQEZFWAUUPFwj$@invalid.uk.co.demon.merlyn.invalid>
In reply to#12325
In comp.lang.javascript message <jiobvv$i1t$1@news.albasani.net>, Thu, 1
Mar 2012 18:35:02, Andreas Bergmaier <andber93@web.de> posted:

>Dr J R Stockton schrieb:
>
>> A local page could be an HTA using MSIE in Windows, in which case I'd
>> expect the API to include a noisemaker.
>
>So, is there any?

If I had known, I would have said so.  But Google   windows sound API
JScript   will give you some starting points.


>> in Opera, executing
>>     location.href = "file://localhost/C:/Windows/Media/Ringin.wav"
>> produces that sound.
>
>But that solution won't give you a volume control, will it? A HTML5
>audio element would have that feature.

In IE8 I see it using RealPlayer, with a working volume control.

>> The file ding.wav might be preferred; or Windows XP Balloon.wav.
>
>I can't hear anything at Windows/Media/ding.wav, but Windows/Media/<the
>me>/Windows%20Ding.wav might be a good choice.


Probably depends on version (mine is Win XP sp3).  Perhaps best to copy
a suitable .wav (or other?) file to a convenient location.

-- 
 (c) John Stockton, nr London UK.  ?@merlyn.demon.co.uk  DOS 3.3, 6.20; WinXP.
  Web  <http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms and links.
   PAS EXE TXT ZIP via  <http://www.merlyn.demon.co.uk/programs/00index.htm>
   My DOS  <http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web