Here is a page where we test various ways to embed .ogg files into a web page. If you're interested in a different audio format, try one of the pages on the left.
First off, we can just put in a bare link. So here's the link to the famous Summertime Blues.
<object> Tag Set
Then, we'll play Summertime Blues, but using an unadorned <object> tag.
I commented out the tag. Several browsers will play .ogg files with the <object> tag, but those that do autoplay, and I can't make it stop.
This plain object works, but it autoplays, and I couldn't make it not do that.
<embed> Tag Set
Same problem as with <object> tag. The browsers that did play .ogg files called from the <embed> tag, autoplayed.
New HTML5 <audio> Tag Set
Ok, now we'll try the <audio> element.
I had to add the attribute controls="controls" to get it to show up. It plays in non-IE browsers, except for Safari.
Summary
Here's the dope:
- Opera
<object>Does not work--no visible control<embed>Autoplays--no way to turn off--no visible control<audio>Does work- IE6
<object>Does not work--no visible control<embed>Does not work--no visible control<audio>Does not work--no visible control- IE8
<object>Does not work<embed>Does not work<audio>Does not work- Chrome
<object>Autoplays--no way to turn off--no visible control<embed>Autoplays--no way to turn off--no visible control<audio>Does work- FireFox
<object>Autoplays--but then stops--no visible control<embed>Does not work--no visible control<audio>Does work- Safari
<object>Does not work--no visible control<embed>Does not work--no visible control<audio>Visible control but does not work
So, if you're determined to offer up .ogg files, don't expect them to work in IE and don't use any method other than the <audio> tag to put them on your site.
What's next?
Do I want to hunt up some .aiff and RealMedia as well?