<?xml version="1.0" encoding="utf-8"?>

The <source> tag for audio

The <source> tag for audio Bad Practice
The <source> tag for audio Best Practice

The <source> tag doesn't exist on its own and is always a child of <audio> or <video> media tags. It allows you to add a few file sources so that the browser can choose the first <source> it supports. The tag itself doesn't define all file locations. Instead, it contains the src attribute, which specifies the URL address of the audio or video.

Like the <video> element, the type attribute defines common media types that browsers support.

For embedding audio files, you should use the following syntax:

• audio/ogg

• audio/mpeg

Improve your UX & Product skills with interactive courses that actually work