play audio html
snippet in html

play audio in javascript

user8269

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

how do you play audio files on html

user7695

<audio src="sound.mp3" autoplay></audio>

play audio html

user3937


 <audio controls>

  <source src="horse.ogg" type="audio/ogg">

  <source src="horse.mp3" type="audio/mpeg">

 Your browser does not support the audio element.

 </audio>