Steven
Steven

Reputation: 13975

jquery on event make sound

I want to know what is the most optimized and speed efficant way of playing a onevent sound (which will be repeated several if not 100's of times). Obv. adding a embed html code does not work as that would cause it to add and delete an embed html code 100's of times causing slowness or even crash.

What other methods are available for repeative sound?

Upvotes: 1

Views: 636

Answers (1)

Dr.Molle
Dr.Molle

Reputation: 117334

I think the best way this time is still the use of a flash-player which can interact with javascript, so you don't need to embed a sound-file a couple of times, you simply can play the sound if you want to.

If some day HTML5 is supported enough by all browsers, it would be easier using the <audio>-element and its play/pause methods.

Upvotes: 1

Related Questions