Play a sound:
![]()
The <audio> tag is supported in Internet Explorer 9+, Firefox, Opera, Chrome, and Safari.
Note: Internet Explorer 8 and earlier versions, do not support the <audio> tag.
The <audio> tag defines sound, such as music or other audio streams.
Currently, there are 3 supported file formats for the <audio> element: MP3, Wav, and Ogg:
| Browser | MP3 | Wav | Ogg |
|---|---|---|---|
| Internet Explorer 9+ | YES | NO | NO |
| Chrome 6+ | YES | YES | YES |
| Firefox 3.6+ | NO | YES | YES |
| Safari 5+ | YES | YES | NO |
| Opera 10+ | NO | YES | YES |
| Format | MIME-type |
|---|---|
| MP3 | audio/mpeg |
| Ogg | audio/ogg |
| Wav | audio/wav |
The <audio> tag is new in HTML5.
Tip: Any text inside the between <audio> and </audio> will be displayed in browsers that do not support the <audio> tag.
New : New in HTML5.
| Attribute | Value | Description |
|---|---|---|
| autoplayNew | autoplay | Specifies that the audio will start playing as soon as it is ready |
| controlsNew | controls | Specifies that audio controls should be displayed (such as a play/pause button etc). |
| loopNew | loop | Specifies that the audio will start over again, every time it is finished |
| mutedNew | muted | Specifies that the audio output should be muted |
| preloadNew | auto metadata none |
Specifies if and how the author thinks the audio should be loaded when the page loads |
| srcNew | URL | Specifies the URL of the audio file |
The <audio> tag also supports the Global Attributes in HTML.
The <audio> tag also supports the Event Attributes in HTML.
Your message has been sent to W3Schools.