Audio
An audio file in HTML can be embedded on a webpage using the <audio> element. The src attribute is used to specify the source of the audio file, which can be a URL or a relative file path.
Here is an example of how to embed an audio file on a webpage:
<audio controls>
<source src="audio/example.mp3" type="audio/mpeg">
<source src="audio/example.ogg" type="audio/ogg">
Your browser does not support the audio element.
</audio>
In this example, the <audio> element is used to embed the audio file, with the controls attribute to display the audio controls (play, pause, volume, etc). The <source> elements are used to specify the source of the audio file. In this case, two sources are provided, one in mp3 format and another in ogg format. The type attribute is used to specify the audio file format. The text between the <audio> tags is displayed in case the browser doesn't support the audio element.
You can also use autoplay attribute to automatically play the audio when the page loads.
<audio controls autoplay>
<source src="audio/example.mp3" type="audio/mpeg">
<source src="audio/example.ogg" type="audio/ogg">
Your browser does not support the audio element.
</audio>
Additionally, you can use loop attribute to play the audio in loop.
<audio controls autoplay loop>
<source src="audio/example.mp3" type="audio/mpeg">
<source src="audio/example.ogg" type="audio/ogg">
Your browser does not support the audio element.
</audio>
It's important to note that, not all browsers support the same audio file formats. MP3 and Ogg are the most widely supported formats.