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.
These pages 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.
I'll focus on the replay of simple uncompressed (aka PCM) WAV files, since that's what we
use for perceptual experiments. Many of these techniques will work with MP3 or OGG compressed files, too.
Methods
- Normal Hyperlink to a Sound File
- Embedding a Sound File
- Controlling an Embedded Sound using JavaScript (Old method)
- Controlling an Embedded Sound using JavaScript (New method)
- Using a Background Sound and JavaScript
- Using Dynamic HTML
- Using a Java Applet
- Using a Java Applet and JavaScript
- Using a Flash audio player
- Using HTML 5 Audio tag