We're calling on all EU-based Mozillians with iOS or iPadOS devices to help us monitor Apple’s new browser choice screens. Join the effort to hold Big Tech to account!

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

How can I make a .wav file as a background on my site work?

more options

Put .wav file as background on a web page. It works on I.E. but not on Fire Fox. How can I fix this?

Put .wav file as background on a web page. It works on I.E. but not on Fire Fox. How can I fix this?

Valgt løsning

The BGSOUND tag has never worked in Firefox, this is an IE only feature you can use to play an audio file. In Firefox you used to use the EMBED or OBJECT tag to play audio files via a plugin like Windows Media Player. Current Firefox releases only support the Flash plugin and that makes that you need to use the AUDIO tag like I posted above.

You can test whether Firefox can play this WAV file via the HTML5 media player by opening the file via the location/address bar in a tab. If you do not see the player or there is no sound then check the Web Console for error messages.

A basic AUDIO tag would be this code. If the file is in another folder then you may need to prefix with the protocol and path. This code should be in the body and not in the HEAD tag.

<audio src="bgmusic.wav" controls>
Les dette svaret i sammenhengen 👍 0

All Replies (11)

more options

So what is the coding like for that?

more options

I had a video, only wanted sound so found a tool to convert .mov file to .wav file and then used the new .wav file as background sound on my web page. Works on IE but not on Fire Fox or the Bing on my Kindle. I'm just wondering if I can make it more universal so it works on other web browsers.

more options

He was asking about the HTML coding for you webpage that you are attempting to use.

Internet Explorer only can use a HTML Background Sound element (<bgsound>) sets up a sound file to play in the background while all other browsers would need to use <audio> instead.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/bgsound

more options

You can only use an audio tag in modern browsers to play audio.

Note that you shouldn't play background music automatically because not everybody appreciates it if music starts playing when you visit a web page although Firefox might mute it.

Endret av cor-el

more options

I'm sorry to be so obtuse. I understand I need to change the code but I'm unclear as to how. I'm in my mid 70s and at the moment am suffering with Shingles. Need to do this for a customer. Here is the code I have. How would I change it: <bgsound src="Scot%20Rock%20001%20-%20Copy.wav" loop="1"> </head>

Thanks so much!

more options

Try shortening the name to something like "bgmusic.wav"

The code looks right, but also, maybe don't use background music in the first place. It was cute on Angelfire, but nobody does that anymore except for spammers; let your audience listen to their own music, wow them with the presentation.

more options

I definitely need this on the site. bgmusic.wav where do I insert this in the string and do I use the rest? <bgsound src="Scot%20Rock%20001%20-%20Copy.wav" loop="1"> </head>

Like this? <bgsound src="bgmusic.wav" loop="1"> </head> Thanks so much for your patience. This is for a Scottish Terrier charity and the song is for them. It's just silly but it will bring more Scottie folks to buy their stuff.

more options

Valgt løsning

The BGSOUND tag has never worked in Firefox, this is an IE only feature you can use to play an audio file. In Firefox you used to use the EMBED or OBJECT tag to play audio files via a plugin like Windows Media Player. Current Firefox releases only support the Flash plugin and that makes that you need to use the AUDIO tag like I posted above.

You can test whether Firefox can play this WAV file via the HTML5 media player by opening the file via the location/address bar in a tab. If you do not see the player or there is no sound then check the Web Console for error messages.

A basic AUDIO tag would be this code. If the file is in another folder then you may need to prefix with the protocol and path. This code should be in the body and not in the HEAD tag.

<audio src="bgmusic.wav" controls>
more options

Ok. Here is the string I used: <audio src="bg1music.wav" loop="-1" controls>

I put it down below the singer figure on the page instead of in the head and it works on Fire Fox (YEA). But, it shows as a grey bar and plays until viewer clicks it off. So this may be the best I can hope for, but, it's there!!! The only prob. is I really need a blues singer. I went to college on a musical scholarship but it sure as hell wasn't voice. The customer is happy and that's what counts. Now I'll add some text to turn it off.

I just can't thank you enough for your expertise and your patience!!! Lee Juslin If you want to see/hear it, www.ibdoggone.com and go to Scotties Rock page.

more options

OK. Spoke to soon. I can get the song on with the grey bar but if I put it beyond the header and just below the singer, you can see anything else on the page. If I put it at the bottom, it doesn't play until someone scrolls all the way down and clicks on the grey bar. Wonder how I can get it near the top without obliterating the rest of the page and how I could get it to automatically shut off after 1 play.

more options

GOT IT!! AGAIN, THANKS SO MUCH!