Home >Web Front-end >H5 Tutorial >Solution to the audio format supported by audio in html5
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 b97864c2e0ef2353a16c4d64c7734e92 tagGiven the current situation, you may think that it is not yet possible to The golden moment for using audio on HTML5 pages. In some ways this may be true, but HTML5 provides a solution that enables your favorite browser to find a compatible format.
When used in conjunction with the b97864c2e0ef2353a16c4d64c7734e92 tag, the e02da388656c3265154666b7c71a8ddc tag can be nested within the b97864c2e0ef2353a16c4d64c7734e92 container. Let's say you're a Wagner fan and want to listen to his opera Ride of the Valkyries on an HTML5 page. First, you need to get your music in three file types, namely OGG, MP3, and WAV. Place these music files in the same folder as the HTML5 files. Then, put each file name in a separate e02da388656c3265154666b7c71a8ddc tag, and all source tags in the audio container are composed of b97864c2e0ef2353a16c4d64c7734e9281d2bc32cafa2076a27f10cdd878d0ab, as shown below.
<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!