By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,652 Members | 1,441 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,652 IT Pros & Developers. It's quick & easy.

Playing a sound in javascript

Jezternz
100+
P: 145
Is there any efficient way to do this?
I found you could do it using
<bgsound> or <embeded>
Are these efficient and are they xhtml valid?
Is there no javascript functionality to play sounds?

Thanks, Josh
Jan 2 '09 #1
Share this Question
Share on Google+
3 Replies


P: 15
Hmmm... without doing some research on Google I don't really know.

You could do it in Flash and trigger it from Javascript.
LongTail Video and the JW Player has a media player that has a javascript API, so you could load the jukebox into a hidden <div> somewhere and then use javascript to tell it which sound to play and when.
Jan 3 '09 #2

gits
Expert Mod 5K+
P: 5,390
there is no JavaScript-method that plays sound ... but i think you may go for the <object>-tag

kind regards
Jan 3 '09 #3

acoder
Expert Mod 15k+
P: 16,027
See Playing Sounds In The Browser - use a browser helper object.
Jan 9 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.