如何在网页中创建蜂鸣声?

发布于 2024-09-27 16:14:04 字数 448 浏览 0 评论 0原文

我想在网页中的服务器错误上创建蜂鸣声。我已经搜索并阅读了以下页面以在网页上显示声音。 http://www.phon.ucl.ac.uk/home /mark/audio/play.htm 但我不能要求用户安装插件和其他东西。我需要在电脑扬声器上发出两声蜂鸣声。我尝试使用 System.out.print("\\007"); 和 Toolkit.getDefaultToolkit().beep(); 但没有任何效果。在我的 JSP 中,我以这种方式调用:

     <%
Toolkit.getDefaultToolkit().beep();
 System.out.print("\\007");
  %>

有什么方法可以生成声音吗?

I want to create a beep on server error in a webpage. I have searched and read the pages below on to display sound on webpage.
http://www.phon.ucl.ac.uk/home/mark/audio/play.htm
But i can't ask users to install plug ins and other stuff. I need to generate two beep on PC speaker. I have tried to use System.out.print("\\007"); and Toolkit.getDefaultToolkit().beep(); but nothing is working. In my JSP i Called in this way:

     <%
Toolkit.getDefaultToolkit().beep();
 System.out.print("\\007");
  %>

Is there any way i can generate sound?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ペ泪落弦音 2024-10-04 16:14:04

问题是你想做一些客户端的事情,我能想到的唯一方法是使用带有蜂鸣声的javascript警报功能(但这取决于用户的操作系统和声音方案)。

Thing is you wanted to do something that is client side, which the only way I can think of is to use the javascript's alert function which comes with a beep sound (but this depends on the user's OS and sound scheme).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文