发布ASP.NET Web应用程序时,听不到任何声音

编程入门 行业动态 更新时间:2024-10-27 17:12:28
本文介绍了发布ASP.NET Web应用程序时,听不到任何声音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在ASP.NET中有一个网站应用程序。我有一些波浪声。一切都在计算机上工作(在localhost中)。当我发布网站时,我没有错误,但按下按钮时,没有声音。我什么都没听到。我究竟做错了什么?谢谢

I have a website application in ASP.NET. I haveone wave sounds. Everything works in the computer(in localhost). When I publish the website, I have no error but when press the button, there is no sound. I don't hear anything. What am I doing wrong? Thanks

System.Media.SoundPlayer player = new System.Media.SoundPlayer(); player.SoundLocation =Server.MapPath("~/Sounds/Incoming_Message.wav"); player.Play();

推荐答案

看起来你使用C#来播放服务器端的声音。 要在客户端(通常是Web浏览器)上播放声音,您可以使用HTML(特别是HTML5),Javascript: 播放HTML中的声音 - W3Schools [ ^ ] 或使用javascript播放声音 [ ^ ] 在闪存中:在Flash中使用声音 [ ^ ] 干杯, Edo It looks like you used C# which will play sound on the server side. To play sound on the client side (typically a Web Browser), you can use HTML (and especially HTML5), Javascript: Playing Sounds in HTML - W3Schools[^] or Play sound with javascript[^] In flash: Using sounds in Flash[^] Cheers, Edo

嗯,声音是在服务器上播放而不是在客户端计算机上播放。这就是为什么你听不到它:)所以,要在客户端机器上播放声音,你需要使用HTML< embed />来嵌入声音。标记如< embed src =sound.wav/>。您可以在互联网上找到嵌入标签的详细信息。 Well, the sound is being played on the server and not on the client machine. That's why you can't hear it :) So, to play sound on the client machine, you need to embed the sound using HTML <embed /> tag like <embed src="sound.wav" />. You can find details of the embed tag over the internet.

更多推荐

发布ASP.NET Web应用程序时,听不到任何声音

本文发布于:2023-11-14 14:13:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1587432.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:听不到   应用程序   声音   ASP   NET

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!