Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

play sound javascript

var audio = new Audio("folder_name/audio_file.mp3");
audio.play();
Comment

play a sound wiith js

var audio = new Audio('audio.mp3');
  audio.play();
Comment

play sound in javascript

<script>
function play() {
  var audio = new Audio('https://interactive-examples.mdn.mozilla.net/media/examples/t-rex-roar.mp3');
  audio.play();
}
</script>
<button onclick-"play();">PLAY MY AUDIO</button>
Comment

how to play sound on load js

var sample = document.getElementById("foobar");
sample.play();
Comment

how to play sound on load js

 <audio id="foobar" src="yoursample.ogg" preload="auto"> 
Comment

js play sound

const sound = require("sound-play");
sound.play("file.mp3");
Comment

how to play sound on load js

 #foobar { display: none }
Comment

PREVIOUS NEXT
Code Example
Javascript :: string literal javascript 
Javascript :: create a download file from blob url 
Javascript :: javascript getcontext 
Javascript :: preg_match javascript 
Javascript :: angular call child method from parent 
Javascript :: vue call method after render 
Javascript :: javascript execute function by string name 
Javascript :: js get file location 
Javascript :: integer to array javascript 
Javascript :: mongoose update push 
Javascript :: javascript edit form value 
Javascript :: javascript execute powershell script 
Javascript :: datatables get all checkboxes with pagination 
Javascript :: firebase.database.ServerValue.TIMESTAMP 
Javascript :: math.min 
Javascript :: ejs display variable 
Javascript :: sfc in react 
Javascript :: window resize next js 
Javascript :: usereducer hook 
Javascript :: reset page js 
Javascript :: How to get latitude and longitude from address in angular 6 
Javascript :: react webpack.config.js example 
Javascript :: this element in javascript 
Javascript :: app script map fit markers 
Javascript :: extends in javascript 
Javascript :: mongo mongoose join aggregation lookup 
Javascript :: how to make an array in javascript 
Javascript :: Map and Filter methods used together 
Javascript :: react 18 render 
Javascript :: mongoBD increment 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =