You have to decide on what sort of sound loop you want, and then determine that you really DO want to annoy the heck out of the people visitng your site.
For loops most people use wavs and midis, for longer bits you would use streaming audio such as real audio or mp3, etc.. there are lots of file types.
You have to find your target audience and determine what type of plug-in they would already have and then go to those sites and follow their directions for installing the sound clip.
You can even use Flash and embed a wav.
Here is a way to embed a midi, which is what you hear on most sites, this script goes in head, not body:
<SCRIPT LANGUAGE="JavaScript">
<!--
if(navigator.userAgent.indexOf("MSIE"

!= -1)
document.writeln ('');
else
document.writeln ('<EMBED SRC="
AUTOSTART="true" HIDDEN="true" VOLUME="80%">');
//-->
</SCRIPT>
hope this points you in the right direction When in doubt, deny all terms and defnitions.