HTML <audio> srcAttribute
Example
Play audio:
Your browser does not support the audio element.
</audio>
Try it Yourself »
Browser Support
![]()
![]()
![]()
![]()
![]()
Internet Explorer 9+, Firefox, Opera, Chrome, and Safari browsers all support the src attribute. However, not all browsers support all audio file formats.
Note:Internet Explorer 8 and earlier IE versions do not support the <audio> tag.
Definition and Usage
The src attribute describes the address (URL) of the audio file.
Audio in Ogg file format can be played in Firefox, Opera, and Chrome browsers.
If you need to play audio in Internet Explorer and Safari browsers, you must use an MP3 file.
To be compatible with all browsers - use the <source> element inside the <audio> element.<source>The <source> element can link to different audio files. The browser will use the first recognized audio file format.
Example
<source src="horse.ogg.html" type="audio/ogg">
<source src="horse.mp3.html" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
Try it Yourself »
Difference between HTML 4.01 and HTML5
The <audio> tag is new in HTML5.
Syntax
Attribute Value
| Value | Description |
|---|---|
| URL |
Specifies the URL of the audio/video source. Possible values:
|
Other Extensions
HTML <audio> Tag