views:

164

answers:

2

I am making a game in an HTML web page. How would I add music to this game?

+1  A: 

Try this

<embed src="success.wav" autostart=false loop=false>

You may use javascript also

function func1() { 
document.all.sound.src = "sound.wav"
} 
window.onload=func1; 
alejandrobog
Is there anyway for it to play without showing a Music Player? This is for a game. I need it to just play.
Henry D'Andrea
<embed src="nice music tone.mp3" autostart="true" loop="true" hidden="true">
Henry D'Andrea
You may use javascript alsofunction func1() { document.all.sound.src = "sound.wav"} window.onload=func1;
alejandrobog
Is there any code that can be run on Canvas or HTML5 audio Tag? This is for a Mobile Phone game.
Henry D'Andrea
+3  A: 
<embed src="bgsound.mp3" autostart="true">

http://www.htmlf1.com/tutorial/html-background-music.html

zed_0xff
Is there anyway for it to play without showing a Music Player? This is for a game. I need it to just play.
Henry D'Andrea