Learn Create Your Own Split Screen

Next Page

Just as we load images from a web address (url), so we load sounds. The result goes in a Javascript variable.
var scream = new Audio("http://www.s2js.com/snd/etc/scream.mp3");

The HTML sound object comes with a range of properties and methods.

play() Plays the sound
pause() Pauses the sound, if it's playing
duration Returns how long the audio plays for
currentTime Returns or sets where the playing is up to. Setting to zero "rewinds" the clip
loop Sets or returns whether the clip loops continuously
volume Sets or returns the volume

There's a dozen or so other methods and properties for doing various things. You can find the full list at here.