Inserting AUDIO Into A Web Page?

They have: 12 posts

Joined: Oct 2003

I have an audio file that is about 4-6 seconds in length. My goal is to have it play (as an intro) when a web page is opened. What is the best format to have it in? Which loads fastest and will play on any viewers computer?

Bob

Remember: If you keep doing what you're doing, you'll keep getting what you're getting!

Busy's picture

He has: 6,151 posts

Joined: May 2001

midi or wav are probably the best but people tend to hate audio on websites, a lot even surf with speakers turned off. sometimes it's also the very last thing to load.

<embed src="yoursound.mid(or .wav)" autostart="false"
width="144" height="60" controls="console">
<noembed>
<bgsound src="yoursound.mid(or .wav)" controls="console">
</noembed>
' Use the console option and offer your quests the choice

They have: 218 posts

Joined: Apr 2001

For bg sounds, flash is best imo. wav files tend to be too large, and need compressing. Flash 6 and up can dynamically load .mp3's.

The Webmistress's picture

She has: 5,586 posts

Joined: Feb 2001

Just make sure you have a way for people to turn it off!

They have: 12 posts

Joined: Oct 2003

Some success. When I "preview" the page on my browser, it works just fine. However, when I uploade it to my server, it will not only NOT "auto-play", but, it won't play at all. I've verified that the audio file is there. What can my problem be?

Also, I need a similar "exit" sound to play when they LEAVE the page. How can I do this?

Bob

Remember: If you keep doing what you're doing, you'll keep getting what you're getting!

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Flash would be best, I agree. Controls would be great, too. I know that sometimes you want to set a mood, but you may piss off your users doing it.

Best recommendations:

1. Use Flash
2. Provide controls to turn off/on, volume
3. Allow the user to set a state for the music so that if they are return visitors they can choose whether they hear the music or not on start up (use a cookie)

They have: 12 posts

Joined: Oct 2003

I attempted to insert it as a flash object, which I've never done before.

Now, I have 2 problems. First, the original player won't play and now that I have the flash in, the page won't complete loading at all.

The URL is here TEST PAGE

Geeze .... and I thought this was gonna be an easy task Sad

Bob

Remember: If you keep doing what you're doing, you'll keep getting what you're getting!

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Er.... well, you do know that you actually have to open Flash and import the file, right!?

They have: 12 posts

Joined: Oct 2003

Suzanne wrote: Er.... well, you do know that you actually have to open Flash and import the file, right!?

First of all, I attempted to make it clear that I had not used flash before.

Second, no further responses on this topic are necessary. The condensending attitude that your last response was put was enough for me to find assistance elsewhere!

Bob

Remember: If you keep doing what you're doing, you'll keep getting what you're getting!

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Bob, I wasn't being condescending, I was serious.

If you're brand new to Flash, I recommend that you do their in-program tutorial, and check on the Macromedia forums for help on embedding music into it. Guessing and getting defensive isn't going to help you learn.

They have: 218 posts

Joined: Apr 2001

Actually, you don't have to import the file, typically you would create a soundObject container you can load different files into dynamically, and then adjust properties like volume etc. There are prebuilt component players out there also, probably a better option for a novice.

TM

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

Is it just me, or is having audio controls for a 4-6 second file rather redundant? Really, I think that in this case the usual warnings about audio are a non-issue. I'd have to see it in action, but something this short shouldn't really be a problem for users. Allowing them to set a preference for their next visit is a good idea though.

That URL you linked to isn't working. Did you take the page down or is there some sort of server problem?

I'm sorry you haven't been able to find the help you need here. Using a wav file as busy described would probably be the simplest option for you right now.

If that is working on your computer but not on the server you might want to ask your host if they have any settings enabled that might cause a problem. That's the only thing I can think of, but I really have no idea if it's even possible to disable that sort of thing on the server side.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.