Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML audio src attribute

HTML

HTML audio Tag Reference HTML

Example

Play audio:

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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


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.

To play audio in Internet Explorer and Safari browsers, you must use MP3 files.

To be compatible with all browsers - please in the

Example

Try it »


Differences between HTML 4.01 and HTML5


Syntax

Attribute values

Value Description
URL

Specifies the URL of the audio/video source.

Possible values:

  • Absolute URL - points to another website (e.g. src="http://example.com/movie.ogg")
  • Relative URL - points to a file within the website (e.g. src="/data/movie.ogg")
  • |

    HTML audio Tag Reference HTML