0

I need to Implement an object(or sth else) to play sounds in Web.

I've searched a lot but there were nothing that can play sounds in each browser. I mean that there was a code for each browser.

My question is that if there is a code that can be used in every browser.

Thanks in advance, and sorry for my bad English!!!!!!

Amir
  • 820
  • 9
  • 30
  • A similar question answered already: http://stackoverflow.com/questions/187098/cross-platform-cross-browser-way-to-play-sound-from-javascript – Naveed Ahmad May 11 '11 at 14:53

2 Answers2

2

May we can start by throwing some light on 5 widely accepted ways to add sound on ur webpage.

  1. MIDI Files - Small Size, Easy to implements but looks amateurish n dicy.
  2. WAV Files - Easy again, but they don't loop. So file size may get bigger too.
  3. MP3 Files - Ensure quality, but required external player, certainly not user-friendly.
  4. Flash Files - Flexible, Small and can loop. The only road block, creating one of ur own requires buying a Flash software.
  5. Pre-build Flash Loops - Small, made by professionals (www.flashmusictracks.com, www.flashkit.com). See if u can find something to suit u. Thr cud be more sites like i mentioned.

Just so u know, Google used flash loops when it embedded sounds for its pacman logo, on its home page.

a6hi5h3k
  • 671
  • 3
  • 7
1

For HTML5 you can use audio tag

<audio src="hello.wav"></audio>
Anish
  • 2,889
  • 1
  • 20
  • 45