This site is mobile accessible. Press the "Tap Here" button to use a smaller font-size.
Smartphone icons created by Freepik - Flaticon
The HTML
element is used to play an audio file on a web page.To play an audio file in HTML, use the
element:<audio controls> <source src="horse.ogg" type="audio/ogg"> <source src="horse.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio>
The numbers in the table specify the first browser version that fully supports the
element.Element | |||||
---|---|---|---|---|---|
<audio> | 4.0 | 9.0 | 3.5 | 4.0 | 10.5 |
There are three supported audio formats: MP3, WAV, and OGG. The browser support for the different formats is:
Browser | MP3 | WAV | OGG |
---|---|---|---|
Edge/IE | YES | NO | NO |
Chrome | YES | YES | YES |
Firefox | YES | YES | YES |
Safari | YES | YES | NO |
Opera | YES | YES | YES |
File Format | Media Type |
---|---|
MP3 | audio/mpeg |
OGG | audio/ogg |
WAV | audio/wav |
Tag | Description |
---|---|
<audio> | Defines sound content |
<source> | Defines multiple media resources for media elements, such as <video> and <audio> |