"HTML5 e CSS3 - Módulo 2"
Audio

"Curso em Vídeo"
This is the student's notebook of Ricardo Barros Becheli

Audio

There are two ways of inserting audio into your page:

The <audio> tag

This is "Dubstep", from Bensound:

music1-code

The <audio> plus <source> tags

The <source> element allows you to specify alternative audio files which the browser may choose from. The browser will use the first recognized format.

And here you have "Funkyelement", also from Bensound:

Suppose I had an alternative "ogg" oudio format for this song (which I don't, as you will see in the code. I just staged the snippet to print the image as an example). I would put it just below my main option, which now is the "mp3". If your browser for any reason would not recognize the mp3 file, it would automatically play the ogg one.

music-2 code