HTML5 Audio tag can support wav, mp3, ogg, acc, webm and other formats, but there is a very important music file format midi (extension mid) that does not have built-in support in major browsers. Not all browsers support MP3 OGG and the like. Each browser supports different formats due to copyright issues. This article will introduce to you the solution for audio support audio format in HTML5. Friends who are interested should take a look. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
Browser and Audio Compatibility
Not all browser manufacturers agree on the use of a certain audio file format. For images, files in PNG, JPEG, or GIF format will load into your page on any browser. Unfortunately, this is not the case with audio files. Table 1 shows the audio file formats that can be used in web pages, but not all formats are available in all browsers. For example, Chrome, Internet Explorer 9 (IE9), and Safari browsers do not support WAV files, a declining standard that uses an uncompressed format.
HTML5 Browser and Audio Format Compatibility
Chrome | Firefox | IE9 | Opera | Safari | |
Support | Support | Supported | Not supported | Not supported | |
Supported | Not supported | Supported | Not supported | Supported | |
Not supported | Supported | Not supported | Supported | Not supported |
Solution: Use three file types and the
When used in conjunction with the
<audio controls> <source src=”http://demo.mimvp.com/html5/take_you_fly.ogg” /> <source src=”http://demo.mimvp.com/html5/take_you_fly.mp3″ /> <source src=”http://demo.mimvp.com/html5/take_you_fly.wav” /> </audio>
No matter what browser your visitor is using, it will automatically select the first file type it reads and play the sound for you.
SummaryThe above is the complete content of the audio support audio format solution in HTML5 introduced to you. I hope it can be helpful to everyone. Learning helps. For more related tutorials, please visit
Html5 Video Tutorial php public welfare training video tutorialHTML5 graphic tutorialHTML5Online ManualThe above is the detailed content of Solution to the audio format supported by audio in html5. For more information, please follow other related articles on the PHP Chinese website!