• How to set up an online radio broadcast stream using IceCast and EdCast
  • How to set up an online radio broadcast stream using IceCast and EdCast
    Written by battye
    Mon Nov 02, 2009 6:27 am
     


    For a long time I have been looking for a way to set up an online radio station for my own personal use - I wanted to be able to set up a stream that would broadcast whatever content was being entered through my computers line-in / microphone input. After many failed attempts, I sat down recently with a mission. Not to leave until I had it set up in such a way that I could listen remotely through my iPhone.

    I completed that mission, and I'm going to outline exactly how I did it because I found the Edcast and Icecast documentation - these were the programs I used to achieve this - were severely lacking or far too complicated. In this tutorial I hope to find a middle ground so that everyone can see how relatively straight forward it is to set up an online audio stream.

    Set up a free no-ip.org account

    You might be asking "What on earth is a no-ip.org account?!?", if so the answer is that it's a dynamic DNS service. In simple terms, it allows you to have a standard domain name that points to your computer regardless of the IP address. You have to install a small no-ip.org program that sends a message to its servers when your IP address changes.

    First of all, go to http://www.no-ip.org and set up an account. Once you have got the account set up and logged in, go to the area of the website where you "add hosts".

    Image

    Select a hostname and the domain name. For example, you might want to be called "BobRadioStation.no-ip.org", so you would enter "BobRadioStation" into the hostname box and select no-ip.org from the dropdown list. Select "DNS Host (A)" as the host type.

    Then click submit.

    You will know if it has set up correctly because you will then see this page (manage hosts):

    Image

    It will take about 5 minutes for the DNS to kick in, but this time will pass while you are setting up EdCast and IceCast. For the sake of this tutorial, we'll assume your no-ip.org name is "BobRadioStation.no-ip.org".

    When you are prompted to download the no-ip.org software, do so and install it.

    The main screen looks like this:

    Image

    Tick the host you want to use (you may need to right click and refresh the list if it doesn't appear) and you are done, you can now use your no-ip.org address instead of your physical IP address.

    Download the required software

    Fortunately, all of the software needed for this is absolutely free! You will need to programs, the first being IceCast. Think of IceCast as the "transmitter", this is the program that gets your stream out on to the internet. It can be downloaded from http://www.icecast.org/download.php - I am using Windows XP, so my tutorial will be based on the XP version of IceCast.

    The other program is EdCast, this is the software that "creates" the stream by encoding it to the correct format (mp3, ogg, etc). EdCast can be downloaded from http://www.oddsock.org/tools/edcast/ - select the Standalone version.

    Once both of these programs have been downloaded, install each of them. The install is fairly straight forward, simply follow the prompts once you double click the downloaded file.

    Setting up EdCast

    Once EdCast has been installed, open the application. The first thing you should do is click the black box (peak meter). For some reason, the levels would not appear until I clicked the box - so it is best to get this out of the way first up.

    Then under the live recording box, select the appropriate audio card and in the right box select "Microphone". There are quite a few different options, but I found "Microphone" to be the most flexible (I will explain later).

    Then click the "Add Encoder" button. A new option will appear in the encoder list, right click it and select "Configure".

    You will see this screen:

    Image

    You can select which ever quality settings you would like, I specifically set them quite low because quality was not a major concern for me. Bitrate 32 and sample rate 32000 was sufficient for spoken voice, and will not use up too much bandwidth. For music, you would probably want to set these numbers a bit higher. Whatever you do pick needs to be reasonable compared to your internet connection upstream.

    For the encoder type, I selected MP3 Lame. If you select Ogg you don't need to worry about the quality settings (quality -1 is sufficient I believe), but the benefit of using MP3 is compatibility. For instance, Safari on the iPhone and presumably the iPod Touch as well, will open an MP3 stream automatically in QuickTime player which is very convenient.

    Select Icecast2 as the server type, and in the Server IP area enter the no-ip.org address (ie. BobRadioStation.no-ip.org) and in the server port enter 8000 (which is the default for Icecast, although this can be changed).

    For the encoder password, select a unique password which will match the one you will soon be entering in IceCast.

    The mountpoint is what you want the stream to be called. For instance, in the stream "http://BobRadioStation.no-ip.org:8000/mystreamname" - mystreamname is the mountpoint. I believe that if you select MP3 you can simply give the mountpoint a name, but if you select Ogg then the mountpoint must end in .ogg (I have not personally tested this though).

    For reconnect seconds, enter how long you want it to take for the program to try and re-establish a connection of the connection breaks. I used 1 second in the hope that the connection wouldn't break very often, but you can set this high if you want.

    In the YP settings you will see a screen like this:

    Image

    This is like meta data, this information will appear in certain media players once the stream is opened (such as Windows Media) player. Just enter the appropriate information, and in the Stream URL box enter the full stream address (domain followed by mountpoint, ie. "http://BobRadioStation.no-ip.org:8000/mystreamname")

    Now, click OK. All of the information will be saved now. Right click the encoder and click Connect - it will try unsuccessfully to connect, but this is okay. Once you start IceCast it will connect.

    Setting up IceCast

    Open the IceCast application. You will see this screen:

    Image

    Firstly, click "Configuration" up the top, then click "Edit Configuration". A text file will open up - don't panic. Even though the information looks complicated, it is fairly straight forward.

    Under the <authentication> tag (the file is in XML), alter all instances of "hackme" to whatever password you chose in Edcast. This password will also give you access to the admin interface, which will let you see who is playing your stream and other interesting stats.

    Change the <hostname> tag to your no-ip.org address (without the port and mountpoint). So it may read like <hostname>BobRadioStation.no-ip.org</hostname>

    In the <port> tag below that, you list the port you are using (as mentioned above, 8000 is the default and you may as well use this). One note about the port, you must make sure that it is correctly set up to allow external connections. So if you you need to adjust your firewall or router accordingly then do so, you can see if it is accessible by checking the uTorrent port checker site at http://www.utorrent.com/testport?port=8000

    Once the settings have been adjusted, close and save the file. Then you are ready to go.

    Click the "Start Server" button in Icecast. If you click Source Level Stats, you should see your mountpoint listed as well as the various settings for it. If you go back to the EdCast window, you should see that the stream has connected successfully to Icecast and you will see the current transfer rate.

    How to enter audio into your stream

    If you were to play the stream right now, you would hear dead air. In order to hear sound, you need to plug something into your microphone input (following on what I said about microphone input being flexible).

    You can plug almost anything into the microphone input given that you have a double-ended 3.5mm jack. One option is to loop your computers sound back into itself. By this I mean, suppose you had music playing on the same computer (in iTunes or Winamp, or any other software which produces a sound) then you could plug one end of the cord into the headphone jack and the other into the microphone jack.

    Another option is to plug an iPod or any other type of sound system into your computer. Or even an actual microphone if you want to give a voice stream. The possibilities are endless.

    Listening to your stream

    All good media players should be able to access an MP3 stream. So in Windows Media Player or VLC or Winamp, etc, if you enter "http://BobRadioStation.no-ip.org:8000/mystreamname" (but your equivalent) then within seconds it should start playing.

    My favourite implementation of this is listening to the stream on an iPhone. There are two methods, to use Safari or to use an external app such as FStream (which is free). In Safari, simply enter "http://BobRadioStation.no-ip.org:8000/mystreamname" into the address bar and QuickTime will load the stream automatically. Otherwise, enter the address into FStream or an app of your choice to play the stream that way.

    The benefit of Safari is that the stream will play in the background.

    One important thing to note is that there is approximately a 15 second lag between what is going into to the microphone input to when you hear the stream play. Perhaps on faster systems with faster internet connections, this lag time is lessened.

    Conclusion

    I hope this tutorial has been of some use to you, it certainly took me a while to figure some of these things out - particularly regarding the use of a service like no-ip.org over using an IP address - so hopefully it saves you time to see how I went about it.

    Good luck, and happy streaming!
     
  • Article search
cron