本文介绍了发布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应用程序时,听不到任何声音
发布评论