HTML5 Audio(audio)
HTML5 provides a standard for playing audio files.
Audio on the Internet
Until now, there has been no standard for playing audio on web pages .
Today, most audio is played through plug-ins (such as Flash). However, not all browsers have the same plugins.
HTML5 specifies a standard for embedding audio elements on web pages, using the element.
Browser support
#Internet Explorer 9+, Firefox, Opera, Chrome, and Safari all support the
element.
Note: Internet Explorer IE 8 and earlier does not support the element.
HTML5 Audio - How it works
As To play audio in HTML5, you need to use the following code:
php中文网(php.cn)
您的浏览器不支持 audio 元素。
The control attribute is used to add play, pause and volume controls.
Between and you need to insert the prompt text of the element that the browser does not support.
The element allows the use of multiple elements. The element can link different audio files, and the browser will use the first supported audio file
Audio formats and browser support
Currently, the element supports three audio format files: MP3, Wav, and Ogg:
浏览器
MP3
Wav
Ogg
Internet Explorer 9+
YES
NO
NO
Chrome 6+
YES
YES
YES
Firefox 3.6+
YES
YES
YES
Safari 5+
YES
YES
NO
Opera 10 +
YES
YES
NO
##Audio format MIME Type
##HTML5 Audio Tag
## Format
MIME-type ## MP3
audio/mpeg
Ogg
audio/ogg
Wav
audio/wav
##tag
Attribute
Defines the sound content
Specifies multimedia resources, which can be multiple. Use
in the and tags ##