Live Audio Stream

依然范特西╮ 提交于 2020-01-06 04:32:29

问题


I am trying to setup live internet radio station using icecast server and want my stream to work in all modern browsers. My client only produces .ogg stream. All browsers doesn't play .ogg stream. For eg the .ogg stream I have setup works in chrome but doesn't work in IE. How should I make it run in all browsers?

  1. Is there a way I can convert .ogg stream to .mp3 or any other format on the fly
  2. Embed a audio player in the browser which can play .ogg stream.

Or Any other advice would be helpful.

Regards, Hitesh Bhutani


回答1:


You have several options:

  1. Change encoding format from OGG to MP3 in your Virtual DJ software. Keep in mind that Firefox will not be able to play mp3 streams on some platforms using HTML5 audio tag due to licensing limitations.

  2. Install some kind of transcoding software on your server (where you have Icecast installed and running), for example liquidosap (http://liquidsoap.fm/). Liquidsoap can (among other things) take your stream as an input and transcode it to sereveral formats, for example - mp3, aac, ogg and then your Icecast server will have several mount points available, for example http://yourserver.com:8000/stream.mp3, http://yourserver.com:8000/stream.ogg, http://yourserver.com:8000/stream.aac and then you can create a small javascript that wil detect browser version and choose suitable stream.

  3. Use HTML5 media player like jPlayer (http://jplayer.org/) or Soundmanager2 (http://www.schillmania.com/projects/soundmanager2/). These players can automatically detect browser version and select suitable stream type, also if they can't play the stream using HTML5 <audio> tag, they will fall back to internal Flash based player.

The most advanced way is to combine (2) and (3) methods, that will give you the most browser support.

Supported audio coding formats



来源:https://stackoverflow.com/questions/37783277/live-audio-stream

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!