Skip to main content

How to add HTML5 Audio Tag?

Published: Asked By 1 Answers Answered

Learn how to add the HTML5 audio tag to your web pages. Step-by-step guide with examples to embed and control audio for a seamless user experience.

Share:

1 Answer

H
Hamna Basheer Community Contributor Answered on

The HTML <audio> element is used to play an audio file on a web page.

for example:

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

 

The controls attribute adds audio controls, like play, pause, and volume.

The text between the <audio> and </audio> tags will only be displayed in browsers that do not support the <audio> element.

Supported formats:  .mp3,  .ogg,  .wav

 

Your Answer

Other Resources

Quiz Image
Quiz

Test your knowledge with interactive quizzes.

Interview Questions Image
Interview Questions

Prepare for interviews with curated question sets.

Q&A Image
Q&A

Ask your coding-related doubts and get answers.

Certification Image
Certification

Earn certifications to enhance your resume.

internships Image
Internships

Hands-on projects to improve your skills.

Quiz Image
Quiz

Test your knowledge with interactive quizzes.

Interview Questions Image
Interview Questions

Prepare for interviews with curated question sets.

blog Image
Blogs

Add your technical blogs and read technical topics.

Certification Image
Certifications

Earn certifications to enhance your resume.