HTML5 AUDIO

HTML5 defines a new element <audio> to play a sound on a website.

Syntax HTML5 AUDIO

<audio controls="controls">   <source src="song.mp3" type="audio/ mpeg " />   <source src="song.wav" type="audio/wav" />   <source src="song.ogg" type="audio/ogg " />   Your browser does not support the HTML5 audio. </audio>

Explanation sintaxis HTML5 AUDIO:

The attribute controls adds a control bar with the basic functions: play, pause and volume.

There are 3 types of audio formats: MP3, WAV, OGG

Not all browsers accept all formats, so it is convenient to record our audio in the 3 possible formats and add 3 items routes <source> with audio files, so the browser will load the audio on the first form recognized.

You can also put a text before the </audio> will look if your web browser does not recognize HTML5 AUDIO