Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to play audio in javascript

var audio = new Audio("folder_name/audio_file.mp3");
audio.play();			// start playing audio
audio.pause();			// pause audio
audio.currentTime = 0;	// makes sure audio is played from the beginning when resumed
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #play #audio #javascript
ADD COMMENT
Topic
Name
7+9 =