Page 247 - DCAP303_MULTIMEDIA_SYSTEMS
P. 247
Unit 14: Designing for World Wide Web (WWW)
14.4.3 tips for Using sound notes
• Always use the attribute controls=”true”. This gives the control of the sound back to your
customers. If they want to hear the sound, they can, and if they do not, they can turn it
off.
• Do not use autoplay=”true” or autostart=”true”. Sound starting when the page loads is a
great way to get people to leave your site. They almost never stay long enough to “get into
the mood” of your site. And even if they do not mind the music, they may have music of
their own playing, which your background music will conflict with.
• Link to sound files. Let your readers decide if they want to listen to the music by clicking
on the link. Just let them know that they are going to a sound file.
• Do not use copyrighted songs without permission. The ASCAP, BMI and the RIAA are
very vigilant about pursuing copyright violations. Do not assume that because you found
the song on the Web, even if it is converted into a MIDI or other electronic format, that it
is free for use.
14.4.4 Different Ways to play a sound from a Web page
Why it should be so difficult to replay a sound from a Web page remains a mystery. The following
points demonstrate some of the many ways that have been tried over the years, from the use of a
simple link to the use of the latest HTML 5 <AUDIO> tag. We will focus on the replay of simple
uncompressed (aka PCM) WAV files, since that is what we use for perceptual experiments. Many
of these techniques will work with MP3 or OGG compressed files, too.
Methods
1. Normal Hyperlink to a Sound File
2. Embedding a Sound File
3. Using a Background Sound and JavaScript
4. Using Dynamic HTML
5. Using HTML 5 Audio Tag.
1. normal Hyperlink to a sound file
This is the simplest way but usually causes a helper application to be launched to play the
sound. These helper applications (plug-ins) are often not configured correctly. Sometimes the
link will display a new page; sometimes it will just offer the file for download. Even if the helper
application works, buffering the sound often causes problems. Either the replay starts too late
and you have to wait for the whole audio to be downloaded, or it starts too early and runs out
of data part way through.
<a href=”success.wav”>Play Sound</a>
2. embedding a sound file
The EMBED tag causes the sound file to be downloaded when the page itself is downloaded
(just like an image would be). The browser then looks for a Plug-in to play the file. The Internet
Explorer will typically use the Windows Media Player plug-in for sound files. Mozilla requires
you to install a suitable plug-in such as Quick Time. A disadvantage of the EMBED tag is as
follows: Since you do not know the dimensions or the name of the plug-in, it is hard to control
the size and format of the player’s appearance.
<embed src=”success.wav” autostart=false loop=false>
LoveLy professionaL University 241