Horje
What is HTML Audio

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

The <audio> HTML element is used to embed sound content in documents. It may contain one or more audio sources, represented using the src attribute or the <source> element: the browser will choose the most suitable one. It can also be the destination for streamed media, using a MediaStream.


Example of HTML Audio

To play an audio file in HTML, use the <audio> element:
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<audio controls>
  <source src="https://www.w3schools.com/html/horse.ogg" type="audio/ogg">
  <source src="https://www.w3schools.com/html/horse.ogg" type="audio/mpeg">
Your browser does not support the audio element.
</audio>

</body>
</html>

Output should be:

Example of HTML Audio
Reffered: https://www.w3schools.com/html/html5_audio.asp





Related Articles
What is HTML Audio HTML Audio
How It Works HTML Audio HTML Audio
How to set HTML <audio> Autoplay HTML Audio
How to Add muted after autoplay HTML Audio
What are the HTML Audio Formats HTML Audio
What are the HTML Audio - Media Types HTML Audio
What are the HTML Audio - Methods, Properties, and Events HTML Audio

Single Articles
Example of HTML AudioHTML Audio

Read Full:
HTML Audio
Category:
Web Tutorial
Sub Category:
HTML Audio
Uploaded:
10 months ago
Uploaded by:
Admin
Views:
35



Share on: