开发者

How to play audio in javascript in any recent web browser... and distribute the encoder?

开发者 https://www.devze.com 2023-03-07 13:30 出处:网络
I can\'t find a way to play back audio in any recent browser, using javascript, especially if I want to be able to distribut开发者_如何学Goe an audio encoder to create the audio files (which forbids m

I can't find a way to play back audio in any recent browser, using javascript, especially if I want to be able to distribut开发者_如何学Goe an audio encoder to create the audio files (which forbids mp3 format). The audio files could be either on the server or stored locally. The issues are:

  • Using the HTML5 audio tag, with a flash fallback libraries (such as jplayer, soundmanager2 or projekktor) is easy but the only format that would work anywhere is mp3.
  • I could use speex/flv but it would only work with flash, forbidding iphone/ipad.
  • A plain wav file would not work on IE 8, 7, 6

A reasonable list of recent browser to be supported is: IE 8-9, FF 4, Chrome 11 and safari 4, including on iphone/ipad.

The only solutions I would see would be to implement a wav file player in flash, as suggested here (but I would have to learn how to program actionscript), or to encode the files in a free format, upload them, and re-incode them to MP3 on the server (but lot of server CPU load).

Do you know any solution without these drawbacks?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号