Computer Science, asked by vivacomputer8522, 1 year ago

How to play sound file in a web-page in the background?

Answers

Answered by riyadas03
0
<!DOCTYPE html>

<html>

<body>

<audio controls>

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

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

</audio>

</body>

</html>



Just change it according to you.
Hope it'll help you.
Answered by Yogesh0970
0

I want to play a sound file on my web-page in the back-ground(don't want Media player UI to appear), my web-site will run on Fire-Fox, i used the Embed element and set the Hidden attribute to be true <embed name="myMusic" src="Masgon.mp3" type="audio/midi" autostart="false" Hidden="true" loop="true"></embed> the problem is that no sound is played unless i removed the hidden attribute on this case the sound file is played and the media player UI appears but i don't want that.

Similar questions