如何在嵌入式asp.net媒体播放器中播放.wav文件? [英] How to play .wav files in embedded asp.net media player?

查看:75
本文介绍了如何在嵌入式asp.net媒体播放器中播放.wav文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试使用MVC中的嵌入式窗口媒体播放器来播放.wav文件。

我几乎成功地玩了所有的其他格式,但不知何故.wav文件(我实际需要)搞砸了,WMP不在下面播放它是我的代码。

查看





Hi,
I'm trying to using the embedded window media player in MVC to play .wav files.
I'm pretty much succeeded in playing all the other formats but somehow .wav files (which i actually need ) are messing it up and WMP is not playing them below is my code.
In View


<object id="mediaPlayer" type="application/x-oleobject" width="100%" height="100%" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"  >

                       <param name="URL" value=""  />
                       <param name="enabled" value="true" />
                       <param name="animationatStart" value="1" />
                       <param name="transparentatStart" value="true" />
                       <param name="autoStart" value="false" />
                       <param name="showControls" value="true" />
                       <param name="Volume" value="-300" />
                       <param name="ShowDisplay" value="0"/>
                       <param name="ShowGotoBar" value="0"/>
                       <param name="ShowControls" value="1"/>
                 <param name="ShowAudioControls" value="1"/>

                   </object>





这是我的javascript代码





and this is my javascript code

document.getElementById("mediaPlayer").URL = "E:\\HyperEngine\\Recordings\\20141223_193917_026_00_000.WAV";

     document.getElementById("mediaPlayer").controls.play();



如果我给出路径和mp3文件但是wav文件,一切都是公平和良好的。非常感谢任何人的帮助。

PS:我知道我也可以使用其他媒体播放器,这使用WMP是具体要求所以我必须找到一个解决方案..


everything is fair and good if i give the path of and mp3 file but wav file.anybody's help is really appreciated.
P.S: I know I can also use other media players, this using WMP is the specific requirement so I have to find a solution to this..

推荐答案

我可以看到, WAV的内容类型,audio / vnd.wave标准化:

http:// tools。 ietf.org/html/rfc2361 [ ^ ]。



这是我的测试:

As I can see, the content type for WAV, "audio/vnd.wave" was standardized:
http://tools.ietf.org/html/rfc2361[^].

This is my test:
<?xml version="1.0" encoding="UTF-8"?>
<html>
<body>

<audio controls = "controls" >
  <source src="test.wav" />
  <p>Your user agent does not support the HTML5 Audio element.</p>
</audio>

</body>
</html>

它有效,但前提是我省略类型= 音频/ vnd.wave。我用过Mozilla SeaMonkey v.2.30;对于其他浏览器,对此HTML5元素的支持可能会有所不同。我仍然认为它应该适用于几乎所有非废话浏览器。



我已经提到了另一种解决方案,即可在运行时或上传后对WAV进行转码(我不是知道你的情况)并讨论了可能的性能成本。



-SA

It works, but only if I omit type="audio/vnd.wave". I used Mozilla SeaMonkey v.2.30; for other browsers, support of this HTML5 element could be different. I still think it should work on nearly all non-nonsense browsers.

I already mentioned another solution, with transcoding of WAV on the fly or after uploading (I don't know your scenario) and discussed possible performance costs.

—SA


WMP肯定可以播放wav文件。这是另一端的问题:]
WMP surely can play wav files. It was problem at other end :]


这篇关于如何在嵌入式asp.net媒体播放器中播放.wav文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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