Dofactory.com
Dofactory.com
Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

HTML <audio> src Attribute

The src attribute on an <audio> tag specifies the URL or path of an audio file.

This attribute is an alternative to a <source> tag inside the audio element.

Example

#

A src attribute on an <audio> tag.
The attribute references an audio file.

<audio src="/media/epic.mp3" controls>
</audio>

Using src

The src attribute specifies the URL or path of the audio file.

This attribute is an alternative to placing a <source> tag inside the audio element.

With a srcattribute only one file can be specified, whereas <source> tags allows multiple files.

The URL of the audio file can be internal (from same website) or external (another website).


Syntax

<audio src="URL" >

Values

#

Value Description
URL URL or path to an audio file.

Browser support

Here is when src support started for each browser:

Chrome
4.0 Jan 2010
Firefox
3.5 Jun 2009
IE/Edge
9.0 Mar 2011
Opera
11.5 May 2011
Safari
4.0 Jun 2009

You may also like

 Back to <audio>

Last updated on Sep 30, 2023

Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

Guides