Sample code for HTML5 Audio element :
<source src=”audiofile.ogg” type=”audio/ogg” />
<source src=”audiofile.mp3″ type=”audio/mp3″ />
Your browser does not support the audio tag. View in a different browser.
Attributes for audio element :
controls : adds controls to your audio element such as play, volume and pause.
type : specifies type of format for the audio file.
src : source or location of your audio file.
Audio element supports multiple source file for your audio. Note that different browsers support different format for both Audio and Video file formats.
Click here to find out files and format supported by various browsers.
Hope this is helpful. Please write your feedback or comments below if you have any questions. We will get back to you!