Tuesday, May 18, 2010

Online Radio for free

I created my own online streaming radio station that allows people to listen to your music as you stream it. So everyone that listens will hear the same thing at the same time. I did this with Windows XP but linux would be even better to use.
I installed Icecast2 which is the program that shows you the radio stations that you are streaming. Make sure to look at the settings first by clicking edit configuration in the configuration menu. Next click the start server button. You can see your music streams by going to for example http://localhost:8000
But once you set up your own VPN or website you can use that ip address to allow anyone to listen. But if you are listening to copyrighted music make sure it requires a password so only you can listen to it. I will add a post sometime about how I got my own website built using dyndns.org for free and can host the website from my own laptop or any other computer using a dynamic ip address.

After I installed Icecast2 I looked on their website and found 3rd party client that will read a playlist of mp3's or ogg file and send them to the Icecast2 service which sends them on to the listeners. I picked Ezstream for the client. All you have to do is make a m3u playlist with a program like VLC. I added as many songs as I wanted to the VLC player then clicked playlist menu and then save playlist to file. I put this file in the Ezstream folder. I also edited the ezstream_mp3.xml file in the example folder and moved it into the root of Ezstream folder instead of the example folder. Next add Ezstream to environment path so you don't have to travel to that folder while in CMD. Then type the command:
ezstream -c ezstream_mp3.xml
This will start the streaming if you did everything right. Then just go to the localhost:8000 address to see all your streams. Click the m3u link to the right to download the m3u playlist that you can open with VLC or any other music player. It will start playing the stream. It took me about 3-4 hours to get everything to work. It would have taken less time if I knew what I was doing.
After getting it to work on localhost I made it work onn my VPN and it works. I also added another xml file for Ezstream that pointed to a different m3u playlist so when someone goes to your port 8000 address page they will see both streams. But you have to have 2 command prompt windows open and do the ezstream -c command using both of your xml files one in each of the cmd windows.

What will I try in the future? I want to use mysql and php with this type of streaming to allow uses to login to a website and they can look through the music that is available and pick music to be qued up next on the radio station. When there is no music qued it will pick a random genre and play the music in that genre for 1 hour and then pick another genre. Too many music stations I know of play a small amount of songs and repeat songs all day. I would want songs to repeat once a week so it doesn't get boring to listen to all day.

No comments: