Home > Web Front-end > H5 Tutorial > body text

Solution to the audio format supported by audio in html5

青灯夜游
Release: 2018-10-09 15:56:20
forward
6218 people have browsed it

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

##Audio FormatChrome FirefoxIE9OperaSafari##OGGMP3WAVThere is no universal file format that every browser All using a single file format means that at least 2/5 browsers will not be able to play certain sounds. This isn't a matter of browser makers being intransigent and unable to agree on a single audio standard, but rather a legal and financial issue involving patent rights and royalties. The OGG format, which is not restricted by software patents, aims to solve this problem once and for all. However, at the time of writing, neither Opera nor Safari support OGG. There are a lot more WAV and MP3 files available than there are files in the OGG format, so no doubt browser manufacturers have taken this into consideration. MP3 as the de facto standard is a great solution.
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>
Copy after login

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

! Related recommendations:

php public welfare training video tutorial

HTML5 graphic tutorial

HTML5Online Manual

The 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!

Related labels:
source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!