HTML and CSS Reference
In-Depth Information
Create a new folder in the tutorials folder called audio, then create a new folder
within the audio folder called media, and create a new file called index.html .
Copy your converted audio files to the media folder and rename them to
audio.ogg and audio.mpg .
Your folder structure should look similar to this.
tutorials
audio
media
audio.mp3
audio.ogg
index.html
Open the index.html file and use the code from Listing 3-24.
Listing 3-24. Embedding Audio in HTML5
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1,
maximum-scale=1">
<title>Testing Audio</title>
</head>
<body>
<audio controls>
<source src="media/audio.ogg" type="application/ogg">
<source src="media/audio.mp3" type="audio/mpeg">
<p>
Your browser does not support HTML5 Audio, <a
href="media/audio.mp3">click
here to download</a>
</p>
</audio>
Search WWH ::




Custom Search