Audio on web pages is one of my biggest pet hates. Not everyone has a fast web connection and many people keep their speakers either low or off. Now that I've said that, here we go:
A Flash file can be set to play on load, but it is not the ideal may of delivering web audio. About the best overall method is to save your audio file[s] as midi files which give pretty good sound quality and relatively small file sizes, then embed them into your page source code as follows:
<bgsound src="location of the file in your web folder on the web server" autostart="true" loop="1">
The loop="1" means it will play only once then stop and the autostart="true" is pretty obvious.
<bgsound src="location of the file in your web folder on the web server" autostart="true" loop="-1">
This one has a different integer applied to the loop instruction. You can either use any positive number: 1 plays a sound once, 2 plays it twice and so on, or you can set the loop to ="true" or ="false". Setting it to a negative number as in loop="-1" is the same as typing the word infinite. It will loop the sound until the page has been left.
<embed src=""> is another method of putting soundfiles into your web pages.
Now, Internet Explorer likes the <bgsound> tag and NetScape likes the <embed> tag.
There are ways of scripting an "if, else" statement into your page so that if Internet Explorer is detected your soundfile launches using <bgsound> else if NetScape is detected the sound will play using the <embed> tag.
I'm not going to go through all of that since it is, frankly, far more work than it is worth and most alternative browsers like Opera, FireFox [formerly FireBird] and similar have the ability for the user to re-set the browser to tell the web server that it is something it is not - in simple terms you can get these browsers to declare themselves as different versions of Internet Explorer or one of the Mozilla/NetScape variants.
If you must use a flash file then you embed the code for it like this:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="click here" >
<param name="movie" value="filename.swf">
<param name="quality" value="high">
<embed src="filename.swf" quality="high" pluginspage="click here" type="application/x-shockwave-flash" >
I've missed out some of the code you can include like heights and widths if you want to display your flash file with visible image properties, loop instructions, autoplay instructions and so on.
Note that parts of the code will turn into blue "click here" hyperlinks because they are the web addresses in hyperlinks for people to download the necessary ShockwaveFlash plugin to play the file if they don't already have it installed. If you copy the code into NotePad it will render properly without changing parts of it into visible links.
So much depends on how you want your sound to start and how many times you want it to play.
Like I said above, it's far more work than it's worth and I advise strongly that you forget the whole idea.