HTML Old School
Sound
Sound is every .wav, .mid, .ra, .au, .ram, or .mp3 file emdede into web page.
There are old BGSOUND and EMBED tags and also new HTML4 AUDIO tag.
BGSOUND
This tag works in Internet Explorer only, so use AUDIO instead.
<bgsound src="./assets/attroubl.mid" volume="5" delay="0" loop="2" >
bgsound example: 0700sound_bgsound.html
EMBED
This tag is obsolete.
<embed src="./asets/attroubl.mid" volume="-300" width="300" height="200" autostart="false">
embed example: 0701sound_embed.html
AUDIO
- new HTML 5 tag
<audio controls>
<source src="./assets/bbking.mp3" type="audio/mp3">
Your browser dont't support audio tag.
</audio>
Example: 0702sound_audio.html
If you want background sound start immediatelly after web page is loaded and without displaying interface use autoplay without controls attribute:
<audio autoplay>
<source src="../slike/bbking.mp3" type="audio/mp3">
Vaš browser ne podržava audio tag.
</audio>
Autoplay example: 0703sound_audio_autoplay.html
Other attributes of AUDIO tag:
autoplay | start audio reproduction without click on play button |
controls | display interface |
loop | play loop |
src="foo.ogg" | audio file URL (better to use <source> tag) |
volume="0.0 - 1.0" | sound volume from 0.0 to 1.0 |