How to put sound on a webpage?

A friend of mine, amateur musician, has started to build a webpage. He wants to be able for visitors to hear his songs, either that the page plays one, or that there’s an option to download it.
He can’t figure it out, and so I agrred to try to help him, since I’ve got Dreamweaver on my computer. “That’ll be easy, I assured him.”
Well, it’s not. I’m totally stumped. I have no flash, shockwave or fireworks to help, only my fellow Dopers.

Please please, do not put the music into the page itself so that it plays when the page loads. Only the blink tag and comet cursors are more annoying than sound effects I didn’t ask for.

It should be no problem to link to an mp3/ogg/$format file like any other link though. I don’t know specifically how to do that in Dreamweaver, but the html is something like:

<ahref=“path to file/filename”>Link text</a>

Let me just add a big Ditto. Though if you have a MIDI, I don’t mind those being ‘forced’ upon a webpage… if it’s a decent MIDI.

To provide his music for download, you’ll want to A.) make sure the file or files are available in the same folder or a subfolder of where his web page files are stored, and B.) Link’em. <a href=“filename”>link text</a>

Warning: my Dreamweaver skills do not rise to the level of expert, by any means.

Having said that, if you want to link to a sound file so that people can listen to or download it, try the following:

  1. Open your webpage in Dreamweaver

  2. Find the place on the page where you want the link

  3. Type in the text you want to use for the song link. e.g. “This is my song”

  4. In the Properties window, find the Link area. Click on the folder to the right of the link, and browse for the music file you want to insert. When you find it, click OK.

That’s about it. This will work much better in terms of relative linking if you have already placed your music file/s in a specially designated assets or music folder, and that folder is close to the HTML folder–preferably a direct subfolder-- in your web layout.

Note: You can also use images instead of text as the link. Place an image on the page, then select the image and follow the same steps.

I tend to agree with the others that inserting sound directly into a webpage is annoying as hell. Nevertheless, if you want to do it, the Dreamweaver instructions offer the following:

Now, you can also insert a background sound without having any media controls on the page. In my opinion, the easiest way to do this is to write it directly into the HTML, using the bgsound tag.

Just after the <body> tag in your html document, put a tag that says:

<bgsound src="[your sound name]" loop=>

[your sound name] should be the name of the sound file, including its three letter suffix and any relative folders.

is the number of times you want the sound to play after the page loads.

For example, if your html file is in a folder named “html”, and your sound is in a folder names “sounds” that is in the “html” folder, and you want the sound to play twice when the page loads, then your tag might look like this:

<bgsound src=“sounds/mysong.mp3” loop=2>

Damn.

Between 3 and 4 there should be another instruction:

3a: Use your mouse or cursor to select the text that will make up the link.

I agree that webpages that play music is annoying as hell. I’d never put it on my webpage, but my friend insists. I’ve tried persuading him not to, so hopefully, he’ll stick with just having files for downloading.

Thanks guys. I’ll copy and paste and send this thread to him.