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

  1. Normal Hyperlink to a Sound File
  2. Embedding a Sound File
  3. Controlling an Embedded Sound using JavaScript (Old method)
  4. Controlling an Embedded Sound using JavaScript (New method)
  5. Using a Background Sound and JavaScript
  6. Using Dynamic HTML
  7. Using a Java Applet
  8. Using a Java Applet and JavaScript
  9. Using a Flash audio player
  10. Using HTML 5 Audio tag

Last revised April 2011.
Mail me if you have some other suggestions.
(c) 2011 Mark Huckvale,
Speech, Hearing & Phonetic Sciences, University College London.