HTML5 audio what audio formats are supported

ぃ、小莉子 提交于 2019-11-28 06:59:48

问题


I have short sound that I wish to play in my webapp using HTML5. I save it in 3 formats. wav, mp3 and ogg

I created 3 tags to play in different formats.

<audio controls autobuffer>
<source src="random_d5c589b1.wav" type="audio/x-wav">
</audio>

<audio controls autobuffer>
<source src="random_d5c589b1.ogg" type="application/ogg">
</audio>

<audio controls autobuffer>
<source src="random_d5c589b1.mp3" type="audio/mpeg">
</audio>

IE9 shows that it can play mp3 and it plays

FF5 shows that it can play wav, ogg. I do not hear it.

Chrome 12 is able to play all 3 formats but I do not hear anything.

When I use different audio files I can hear them in FF and Chrome. But I can't hear those I need.

Here is example:- http://kvartira-n.com/test-site/sound2.html


Thanks to Juhana. The problem was that I had only 2 channel speakers and 5+1 was selected in Windows. It is not clear to me why but some audio 2 channel files were hearable and other wasn't.

Thanks everyone problem is resolved now.


回答1:


You might be interested in a blog post I made recently on HTML5 audio formats. You probably just want to go with AAC and Ogg Vorbis.




回答2:


Here you can check, which HTML 5 features your browser supports. For details on supported audio formats, take a look at Audio section.



来源:https://stackoverflow.com/questions/6762372/html5-audio-what-audio-formats-are-supported

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!