What is the best way to stream a audio file to website users/listeners

Naveen Gamage picture Naveen Gamage · Nov 29, 2012 · Viewed 27.6k times · Source

I'm developing a music site which will stream audio files stored in a server to users, audio files will be played through flash player placed in a webpage..

  1. As I heard I need to use a streaming media server for streaming audio files ( like 2mb to 3mb in size).. Do I need to use one?

    I found some streaming media server softwares like http://www.icecast.org - but as in their documentation, It is used for streaming radio stations and live streaming purposes, but I just need to stream audio files faster and in low size (low bandwidth) with good quality..

  2. I heard I need to encode the audio files first and then send them to listeners and in their end audio files need to be decoded again. Is that true? How can I do that? if I need to use a special web server, where should I host my files? Any good hosting providers?

  3. if I host audio files in a normal web server, they will use HTTP or TCP to deliver my audio files to users/ listners but I found that HTTP and TCP are not good ways to use for multi media purposes like streaming audio and video files, and they are used for delivering HTML and stuff. I found I should use RSTP or UDP for streaming audio files.. What should I use?

  4. I know that .MP3 files has much better quality than the other formats but it also gives huge size to the audio files.. which format should I use for audio files?

  5. Most of the best quality audio files are more than 7mb so I'm planning to convert them my self using a software so I could get low size files with some level of good quality. If I'm converting my audio files what is the good BITRATE I should use for my files?

  6. Any known best softwares for converting audio files while keeping quality in a good level?

Note** - I know that I will not need complex requirements at the beginning of the site but I want to know the best ways like they are using for soundcloud.com

Answer

dutchguy picture dutchguy · Dec 4, 2012

Here´s a reply from someone who actually runs a shoutcast radio station, is an audio-technician and web-designer. Below is knowledge gathered from over 5000 hours of up-to-date research !

6)

  • Audio Software ?

You need to have software that can:

  • Convert to other bitrates and formats
  • Normalize the audiovolume to a same "normalized" level for all mp3´s. (-1 dB)
  • Cut-off silence at beginning and/or end.
  • Equalize the audio so it sounds good.
  • Add effects, Mix...etc.

Best,most-used, very solid and FREE is "Audacity"

5)

  • Good bitrate ?

If the bitrate is to high your listeners on slower connections wil suffer from "bufferunderuns" ie: hickups / short breaks in the audio cause their connection cant keep up with the (to high) speed.

If its to low then the quality is no good.

Best choice is 128 kb/s it sounds good and wont cause underruns for most.

Best format is Mp3 since its the format that can be handled by most players and shoutcast-providers.

Using above your average filesize for a 4 Min track will be around 4 Mb.

Since Mp3 @ 128kb/s is the most popular you will get the best price/quality-deal from a shoutcast server provider .

5b)

  • Audio tagging ?

You did forget that one.

You need to make sure to have your audio-files "Tagged" ie: what is displayed in the players as "Artist - Title" information is not taken from the filename..but instead from the (iD1/iD3) "Tag"

Best, most used, very solid and FREE software is: "mp3tag" it can do "Bulk" also (a 1000 mp3´s at once)

http://www.mp3tag.de/en/

4)

  • Codec ?

You upload your files to a server in the format described above "Mp3 @ 128 kb/s" since its the most used format all players can play it.

Make sure you upload in the same format (above) as the output of the server this will keep a (important) low processor-load on your server (it wont need to convert).

A Shoutcast-server (or other streamserver) will take take your separate mp3´s and convert them into one single realtime stream, it will create multiple streams to multiple listeners (100´s). It will also provide you with statistics (nr of listeners,from where,now playing,played before)

A listener can play it 2 ways:

a-From a embedded player embedded on your website. b-Or by clicking a link on your websit which will open your stream in any (standalone) player your visitor has installed ( Winamp, WindowsMediaPlayer, Realplayer, Quicktime, iTunes...etc) A standalone will give best quality because it will have more/better audiocontrols (equalizer...etc)

Best practice is to offer BOTH a embedded player and a simple clickable link. check out at least 20 radio-station-websites (both professional and amateurs) to see how they do it.

Best , and free embedded-player right now is "jPlayer" because its dual-mode (HTML5 / Flash) so ALL BROWSERS and ALL MOBILES will play it. and its very well supported with a forum,tutorials...etc

http://www.jplayer.org

2)

  • Hosting providers ?

Google for "Shoutcast streaming" or "Shoutcast server" compare 20 of them for best price / quality...research them again using Google.

They will have special shoutcast software (webbased) such as "Centova" you control it from any browser, you can stream live to it...or create playlists that play unattended from the server while you sleep ("autodj") You can create multiple playlists such that they will play at certain times/days/random...etc.

You could create your whole station based on autodj playlists only like that you will not have to worry about your own upload-connection interrupting and you can shutoff your own pc.

For autodj you want a shoutcast service with at least 5 Gb storage (mp3´s) that will give you around 3 to 4 days music without repeats...using the playlists in a clever way and taking into account that listeners will on average listen between 30 mins and 2 hours at certain times,..you can make sure that they will not hear the same tracks all the time.

If you insist to do "live" (realtime) broadcast (streaming) from your OWN computer (directly or via a stream-server-provider then most used software is "Sam broadcaster"

That is it...start with a good Shoutcast server provider, then built your website and create a clickable link to the stream, after that you do the embedded player.