0

how to play song in javascript

25th Aug 2016, 6:49 AM
rasha
4 Respostas
+ 1
here is for "java" there are other tags for "JavaScript"
26th Aug 2016, 11:31 PM
زياد وجدي
زياد وجدي - avatar
0
var audio = new Audio('audio_file.mp3'); audio.play();
13th Sep 2016, 9:07 AM
Akash Chopra
Akash Chopra - avatar
0
as I am new to java :|
13th Sep 2016, 9:08 AM
Akash Chopra
Akash Chopra - avatar
0
hello you can play sound with .play() function <audio id="music"> <source src="beep.mp3" type="audio/mpeg"> </audio> <button onclick="bell()"> Press Here</button> </center> <script type=""> var audio =document.getElementById("music"); function bell() { audio.play() } I hope it will help to you
23rd Apr 2020, 6:12 AM
Ishan Shah
Ishan Shah - avatar