Before HTML5, audio files had to be played in a browser using a plug-in like Adobe Flash.
The HTML <audio> 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](<source>) element
The following code snippet adds an audio file with the filename `tutorial.ogg` or `tutorial.mp3`. The <source> element indicates alternative audio files which the browser may choose from. The browser will utilize the first recognized format.
The `<source>` element enables you to indicate alternative audio files which the browser may choose from. The browser will utilize the first recognized format.
The text between the `<audio>` and `</audio>` tags may be shown in browser that does not support the HTML5 `<audio>` element.
The autoplay attribute will automatically play your audio file in the background. It is considered better practice to let visitors choose to play audio.
The preload attribute indicates what the browser should do if the player is not set to autoplay.