Audio in html

The <audio> tag in HTML allows you to embed audio files (like MP3, WAV, OGG) into your webpage. Users can play, pause, and control the volume.

Basic Audio Example

<audio controls>
    <source src="audio.mp3" type="audio/mpeg">
    Your browser does not support the audio tag.
</audio>

Supported Audio Formats

FormatType AttributeBrowser Support
MP3audio/mpeg✅ Most Browsers
WAVaudio/wav⚠ Large File Size
OGGaudio/ogg⚠ Not supported in Safari

<audio> Tag Attributes

AttributeDescriptionExample
srcSpecifies the audio file URL<audio src="song.mp3"></audio>
controlsAdds default play, pause, and volume buttons<audio controls>
autoplayPlays audio automatically when the page loads<audio autoplay>
loopRepeats the audio file continuously<audio loop>
mutedStarts the audio in a muted state<audio muted>


Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2025 Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz