从PC扬声器点击? [英] Getting a click from the PC-speaker?

查看:62
本文介绍了从PC扬声器点击?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

javascript(轻松)可以从PC扬声器产生咔嗒声吗?

这是直接在(好,以前)的扬声器

CPU -card并且 - 我相信 - 打算向打字员提供反馈

,在每个按键上发出咔嗒声。


在Unix / Linux /上MacOSX系统,你可以通过

键入^ g(控制g)到shell /终端来听到这个点击。当在Emacs中键入^ g时,或者当

Emacs发出错误信号时,这也是

点击。


这不涉及PC的声卡,也不下载

" .wav"文件到用户的系统。


我的一般问题是:javascript可以在用户的​​系统上发出声音

声音(通常情况下,当用户点击

窗口的某些部分时,

和onclick =事件的结果没有某种声音文件

下载了吗? (事实上​​,用户的计算机甚至不需要有一张声卡; PC扬声器是[或者用于

be]直接由内核驱动。)


此致,-Jonathan King,数学,大学。佛罗里达州

Can javascript (easily) produce a click from the PC-speaker?
This is the speaker that is (well, used to be) directly on
the CPU-card and was -I believe- intended to give feedback
to the typist, making a click-sound on each keypress.

On Unix/Linux/MacOSX systems, you can hear this click by
typing ^g (control g) into a shell/terminal. This is also
the click made by ^g when it is typed in Emacs, or when
Emacs signals an error.

This doesn''t involve the PC''s sound card, nor downloading
".wav" files to the user''s system.

My general question is: Can javascript make an audible
sound on the user''s system (typically, as a consequence of
an "onclick=" event when user clicks on certain parts of
the window) WITHOUT some kind of sound file being
downloaded? (Indeed, the user''s computer wouldn''t even
need to HAVE a sound card; the PC-speaker is [or, used to
be] directly driven by the kernel.)

Sincerely, -Jonathan King, Mathematics, Univ. of Florida

推荐答案

2008年5月21日星期三22:03:44 -0700,gentsquash写道:
On Wed, 21 May 2008 22:03:44 -0700, gentsquash wrote:

javascript(轻松)可以从PC扬声器产生点击吗?这是直接在CPU卡上的(好吧,曾经是)的扬声器,而且 - 我相信 - 这是为了给打字员提供反馈,每个按键点击声音


Can javascript (easily) produce a click from the PC-speaker? This is the
speaker that is (well, used to be) directly on the CPU-card and was -I
believe- intended to give feedback to the typist, making a click-sound
on each keypress.



很容易?不是跨平台的方式。


你的shell /终端组合可以做到这一点,因为^ g是ASCII字符

为铃,由终奌站。在旧的日子里,它在愚蠢的电传打字机上敲响了一个非常字面的铃声。

Easily? Not in a cross-platform way.

Your shell/terminal combo can do it because ^g is the ASCII character
for the bell, interpreted by the terminal. In days of old, it rang a
very literal bell on dumb teletype machines.


这不涉及PC'' s声卡,也不下载.wav文件

到用户的系统。
This doesn''t involve the PC''s sound card, nor downloading ".wav" files
to the user''s system.



在我的X11设置中,即使在控制台中,它也会播放WAV文件。我没有b $ b有一个PC扬声器,所以我就这样设置了我的xterm。我没有真正的控制台

哔哔声。

On my X11 setup, it does play a WAV file, even in the console. I don''t
have a PC speaker so I set up my xterm that way. I have no true console
beep.


我的一般问题是:javascript可以发出声音吗

用户的系统(通常,当用户点击窗口的某些部分时,onclick =事件的结果)没有某种声音

文件正在下载? (事实上​​,用户的计算机甚至不需要

来获得声卡; PC扬声器是[或曾经]直接驱动

由内核提供。)
My general question is: Can javascript make an audible sound on the
user''s system (typically, as a consequence of an "onclick=" event when
user clicks on certain parts of the window) WITHOUT some kind of sound
file being downloaded? (Indeed, the user''s computer wouldn''t even need
to HAVE a sound card; the PC-speaker is [or, used to be] directly driven
by the kernel.)



您可以将音频嵌入数据IRL中。我从来没有尝试过这样的b $ b,而且它会在IE下失败。 (至少版本6,但是我不知道
也不认为7或8支持IRL数据。)

You might be able to embed the audio in the ''data'' IRL. I''ve never tried
that though -- and it would fail under IE. (At least version 6, but I
don''t think 7 or 8 support the data IRL either.)


5月22日, 12:04 pm,Jeremy J Starcher< r3 ... @ yahoo.comwrote:
On May 22, 12:04 pm, Jeremy J Starcher <r3...@yahoo.comwrote:

2008年5月21日星期三22:03:44 -0700,gentsquash写道:
On Wed, 21 May 2008 22:03:44 -0700, gentsquash wrote:

javascript(轻松)可以从PC扬声器产生点击吗?这是直接在CPU卡上的(好吧,曾经是)的扬声器,而且 - 我相信 - 这是为了给打字员提供反馈,每个按键点击声音


Can javascript (easily) produce a click from the PC-speaker? This is the
speaker that is (well, used to be) directly on the CPU-card and was -I
believe- intended to give feedback to the typist, making a click-sound
on each keypress.



很容易?不是跨平台的方式。


你的shell /终端组合可以做到这一点,因为^ g是ASCII字符

为铃,由终奌站。在旧的日子里,它在愚蠢的电传打字机上敲响了一个非常字面的铃声。


Easily? Not in a cross-platform way.

Your shell/terminal combo can do it because ^g is the ASCII character
for the bell, interpreted by the terminal. In days of old, it rang a
very literal bell on dumb teletype machines.


这不涉及PC'' s声卡,也不下载.wav文件

到用户的系统。
This doesn''t involve the PC''s sound card, nor downloading ".wav" files
to the user''s system.



在我的X11设置中,它确实播放WAV文件,即使在控制台中也是如此。我没有b $ b有一个PC扬声器,所以我就这样设置了我的xterm。我没有真正的控制台

哔哔声。


On my X11 setup, it does play a WAV file, even in the console. I don''t
have a PC speaker so I set up my xterm that way. I have no true console
beep.


我的一般问题是:javascript可以发出声音吗

用户的系统(通常,当用户点击窗口的某些部分时,onclick =事件的结果)没有某种声音

文件正在下载? (事实上​​,用户的计算机甚至不需要

来获得声卡; PC扬声器是[或曾经]直接驱动

由内核提供。)
My general question is: Can javascript make an audible sound on the
user''s system (typically, as a consequence of an "onclick=" event when
user clicks on certain parts of the window) WITHOUT some kind of sound
file being downloaded? (Indeed, the user''s computer wouldn''t even need
to HAVE a sound card; the PC-speaker is [or, used to be] directly driven
by the kernel.)



您可以将音频嵌入数据IRL中。我从来没有尝试过这样的b $ b,而且它会在IE下失败。 (至少版本6,但是我不认为7或8不支持数据IRL。)


You might be able to embed the audio in the ''data'' IRL. I''ve never tried
that though -- and it would fail under IE. (At least version 6, but I
don''t think 7 or 8 support the data IRL either.)


(我为错误的帖子道歉。)


5月22日下午12:04,Jeremy J Starcher写道:
(I apologize for my erroneous post.)

On May 22, 12:04 pm, Jeremy J Starcher wrote:

2008年5月21日星期三22:03:44 -0700,gentsquash写道:
On Wed, 21 May 2008 22:03:44 -0700, gentsquash wrote:

javascript(轻松)可以从PC扬声器产生点击吗? ...
Can javascript (easily) produce a click from the PC-speaker? ...


轻松?不是跨平台的方式。 ...
Easily? Not in a cross-platform way. ...


在我的X11设置中,它确实播放WAV文件,即使在控制台中也是如此。 ...
On my X11 setup, it does play a WAV file, even in the console. ...



谢谢Jeremy。弱化我的请求...


*任何人都可以指向公共域WAV(或其他常见的

音频格式)文件,轻轻点击或嘟嘟?


*如何将文件的播放附加到onclick ="

事件? (至少,在MacOS上的Firefox下。)


作为一个javascript初学者,我在网上搜索并找到了关于JS音频的帖子

,我没有了解。

为我工作的唯一一个是


< embed src =" file.wav" autostart =" true"

name =" sound1" ID = QUOT; Sound1例子"

Thank you Jeremy. Weakening my request...

* Can anyone point me to public-domain WAV (or other common
audio format) files that have a gentle click or beep?

* How do I attach the playing of the file to an "onclick="
event? (At least, under Firefox on MacOS.)

As a javascript beginner, I web-searched and found postings
on JS audio, which I did not understand. The only one that
worked for me was

<embed src="file.wav" autostart="true"
name="sound1" id="sound1"


>在MacOSX上为我的FF工作< / embed>
>Worked for my FF on MacOSX</embed>



但是,我已经读过< embedis已弃用。

However, I have read that <embedis deprecated.


这篇关于从PC扬声器点击?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆