Page 1 of 1
Sounds.
Posted: Tue Nov 13, 2007 8:07 pm
by JellyFish
Hey, I was wondering how I could play an mp3 file without flash, but with javascript and html?
How can I play a audio file with javascript? How can I use HTML's embed or object element to play a audio file and allow javascript to play the file again and again.
I've tried appending a new embed element into the body element via javascript, but it's not as responsive as I'd like it to be; it's slow; the audio file doesn't play right away.
Hopefully I'm asking the right question; the question that I really am asking.
Thanks for reading. I'd so much appreciate any help with this.
Posted: Tue Nov 13, 2007 8:25 pm
by Christopher
Have to searched for "embed audio file in web page" or similar? There are many, many pages that explain how to use the <object> and <embed> tags to play audio that loops.
Posted: Tue Nov 13, 2007 8:28 pm
by feyd
mmm... reminds me of the early to mid-nineties midi files blasting poop.
Posted: Wed Nov 14, 2007 12:11 am
by Kieran Huggins
mp3? plugin needed for sure. If you use the "embed/object" method it will load a huge player, which majorly sucks. I've implemented a simple flash player for a band website, worked very nicely indeed.
Posted: Wed Nov 14, 2007 5:41 pm
by JellyFish
First, I don't want a looping audio file. I would like to be able to make a sound not with HTML only, but with javascript, only if possible; I don't think I can make a sound with only javascript, but I probably can do it with both HTML and javascript.
To give you an example, how does
this gamedo it?
Posted: Wed Nov 21, 2007 10:23 pm
by JellyFish
Do I make sense?
Posted: Thu Nov 22, 2007 9:30 am
by Kieran Huggins
The code of that page shows them creating an <embed/> tag for sound playback. I have a strong feeling that an embed tag uses the default media player on the system for that particular mime type. On Windows that's probably Windows Media Player, on Mac it's almost definitely Quicktime.
Posted: Sun Nov 25, 2007 9:11 pm
by JellyFish
Kieran Huggins wrote:The code of that page shows them creating an <embed/> tag for sound playback. I have a strong feeling that an embed tag uses the default media player on the system for that particular mime type. On Windows that's probably Windows Media Player, on Mac it's almost definitely Quicktime.
And what do you think on the iPhone?