//Load the sound file (using a source element for expandability) var src = document.createElement(“source”); src.src = “https://www.webdirections.co.uk/wp-content/uploads/2023/01/Good20Bad20Ugly20Theme20meloboom.mp3”; soundFile.appendChild(src); //Load the audio tag //It auto plays as a fallback soundFile.load(); soundFile.play(); //Plays the sound function play() { //Set the current time for the audio file to the beginning soundFile.currentTime = 0.01; soundFile.volume = volume; //Due to a bug in Firefox, the audio needs to be played after a delay setTimeout(function(){soundFile.play();},1); }

Get in touch

We are here to help

Contact us