Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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 add and play sounds in JS

PlaySound = function () {
    var audio = new Audio('~/Content/Sound/Down.mp3');
    audio.loop = false;
    audio.play(); 
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: react native open link in browser 
Javascript :: difference between shift and unshift in javascript 
Javascript :: node get current url 
Javascript :: Update nextjs to 11 
Javascript :: get the difference between two dates js 
Javascript :: add id to html element javascript 
Javascript :: connecting mongoose with express js 
Javascript :: document jquery 
Javascript :: make keystore 
Javascript :: jQuert latest cdn 
Javascript :: url decode in javascript 
Javascript :: get javascript min date 
Javascript :: nodemailer custom font 
Javascript :: discount calculator javascript 
Javascript :: import json file python online 
Javascript :: js check if objects have same values 
Javascript :: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory 
Javascript :: how do i remove all vowels from a string in javascript and return the result 
Javascript :: React’ must be in scope when using JSX react/react-in-jsx-scope 
Javascript :: loop through an array in javascript 
Javascript :: how to go to next page on button click js 
Javascript :: for in object javascript 
Javascript :: reference error $ is not defined jquery 
Javascript :: jquery get text 
Javascript :: react native shaddow 
Javascript :: how to test usestate in jest 
Javascript :: javascript change div order 
Javascript :: canvas umu 
Javascript :: js last word in a string 
Javascript :: convert object to boolean javascript 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =