Advertisement

Google Ad Slot: content-top

Audio Tag

~1 min read · HTML
On this page

What is HTML Audio?

The <audio> tag is used to embed sound content in a web page. It can play formats like MP3, WAV, and OGG.


Basic Example
Try it yourself

Attributes

Attribute

Description

controls

Displays audio controls like play, pause, volume, etc.

autoplay

Starts playing the audio automatically (muted by default).

loop

Loops the audio when it ends.

muted

Mutes the audio by default.

preload

Specifies how the audio should be loaded (none, metadata, auto).


Supported File Formats

Format

MIME Type

MP3

audio/mpeg

OGG

audio/ogg

WAV

audio/wav


Example with Multiple Sources
Try it yourself

Example: Looping & Autoplay
Try it yourself