Q:

Write HTML code to embed the following audio in a document

belongs to collection: HTML5 programming Exercises

0

Write HTML code to embed the following audio in a document

Suppose the audio source is -
http://www.etutorialspoint.com/images/papa_telefon.mp3

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Solution

HTML5 provides audio element to embed audio in web page. Prior to HTML5, we are using third party plug-ins, like - Flash, Window Media Center, Apple iTunes, etc to play audio on the browser. The problem with these plug-ins are that, not all browsers or devices support it. HTML5 provides a standard way to include audio with several attributes which improve its default behavior.

This is the following HTML5 code to embed the given audio -

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

In the above code, controls specify audio control units like Play, Pause, Volume controls, the source contains different types of audio formats to support in different browsers and devices.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Write HTML code to draw an outlined rectangle usin... >>
<< Draw an semi arc using HTML5 canvas...