Embedding Audio
- HTML5 audio
- (text only)
- Before you watch the video about embedding audio, acquaint yourself with HTML5's
<audio>
tag.
- E09b - (4:04)
- Links to mp3 audio files can be as easy as simply putting in a link to the file itself, although there are ways to provide players with more convenience. Here are some options:
- The simplest way to let visitors listen to an mp3 is also the best for accessibility: a simple link to the audio file as in the following two examples (radio promos my wife wrote):
-
We're not afraid
-
Instead of hate mail
- Here is the first audio file again, this time using the <embed> tag, which makes a controller visible and allows the coder to determine whether it will play immediately, the size of the controller, and other attributes. This method of providing audio is widely supported:
- And here is the second audio file, this time with the more "proper" coding, that uses <object> tags. It is not as fully supported and may not work in some browsers: