How To Automate A Radio Station With SHOUTcast



Last updated: January 28th, 2024

Purpose

I want to create my own radio station that runs MP3s for me in a playlist on a VPS (virtual private server) and serves as a SHOUTcast audio streaming server. To do this I will need a VPS with the correct ports open, config settings adjusted to my server, an MP3 encoding license, MP3s, a playlist, SHOUTcast server and SHOUTcast transcoder. If I want to listen to the music on the VPS I will have to connect to it from a computer which has an audio driver since a VPS doesn't have access to a soundcard. This isn't important to do but if I want to hear the song on the server then this is the only way to do it.

SHOUTcast allows the streaming station I'll set up to be accessible through embedded Flash players, iTunes, Winamp and other players.

Programs

There are many possible configurations for SHOUTcast. Essentially the following items are required to be installed (in this order):
- SHOUTcast Transcoder (SC_TRANS) (http://www.shoutcast.com/broadcast-tools)
- SHOUTcast DSP Plug-In for Winamp (http://www.shoutcast.com/broadcast-tools)
What I wanted to do is have a remote server, the VPS in this case, have all these programs installed and play MP3s for me that are on the VPS. This allows the VPS to deal with the bandwidth, SHOUTcast server and song playing. The benefit to this is that I could RDP into the VPS and change the playlist if I want by updating hte playlist and restarting the transcoder. The VPS needs to be able to automate the process of playing music and run the required programs without any effort, non-stop.

Virtual Private Server

The first thing I need is a computer to host a SHOUTcast server. I have decided to use a Windows Server 2012 VPS. In this case I decided to go with: http://www.softsyshosting.com/windows-vps.aspx as they offered a $15/month plan that would allow me to stream to perhaps hundreds of users simultaneously considering the memory and bandwidth allocation. I remote desktop into the VPS and download and install the required programs. For $30/ month I can store over 30GB of music and have fewer bandwidth restrictions.
If I do want to play audio on the VPS itself I must edit:
Remote Desktop Connection > Local Resources tab > Remote audio Settings > Play on this computer.
Through Control Panel I need to find the services on the VPS, start the Windows Audio Service and set it to start automatically. This will force another audio service to start, there are two that need to start on the VPS of Windows 2012 to do this.
Next I'll open Windows Explorer and go to: “C:\Program Files\SHOUTcast” (where the default install was) and change the password and adminpassword in sc_serv_simple.config and sc_serv_basic.config to something else, each needs to be unique.
Then in PowerShell I'll start the server itself so that Winamp and interface with it:
PS> cd “C:\Program Files\SHOUTcast”
PS> .\sc_serv.exe sc_serv_simple.conf 

To be able to administer the server remotely through its IP address I'll go to: Control Panel > System and Security > Windows Firewall > Advanced settings > Inbound Rules > New Rule > select Port > Next, TCP > Specific local ports: 8000 > Allow the connection. Then Domain, Private and Public need to be checked and click Next. The Name can be anything, it will be SHOUTcast for this and then click Finish.

Accessing The Server Online

Now when accessing: http://VPS_UNIQUEIIP:8000/admin.cgi
I login with:
username: admin
password: (adminpassword from the confiig)
Now go to Winamp and go to options and preferences, in the Plug-ins section click DSP/Effect and then double click the SHOUTcast Source. From here input the Server Address as the IP address of the VPS and the password from the config file. After that click the Directory tab and then name the station and put in a URL for the station homepage. On the Encoder tab change the Encoder Type to MP3 Encoder. For Encoder Settings set to the intended Kbps, I'm using 128Kpbs.
Go back to the SHOUTcast admin summary screen on the admin.cgi page and click the “click here” link then click Create Authhash. Fill in the required information and then click the Create Authhash button.
Go back to the directory with the SHOUTcast configs and copy the streamauthhash_1 from sc_serv_simple.config and paste it in the sc_serv_public config section for the streamauthash. Lastly, I'll need to set: streamid_1=1 in the config file that is launched from the command line, sc_serv_simple.conf in this case. This allows server restarts to use the same streamauthhash, keeping my station URL and ID the same.
Once the server is running through PowerShell it can interface with any Winamp player on any computer, I've decided to run Winamp on the VPS as well as the server. After setting the MP3s in the playlist and playing them on random I've created an automated radio system. Eventually both the local computer and the VPS will need to be restarted but as long as the server is running and a Winamp player is connected to it, the radio will go on.

Set Up Options

There are many set up options and this can be done with Linux or Mac as well, for me a low scale Windows VPS was the fastest, easiest and cheapest option. It helps to learn more about SHOUTcast, that can be done on their forum or through their documentation. The correct configuration is simply one that works best for the purpose. Ideally the local computer can be remoted into as well to allow for maximum capability. It's also a good idea to map a subdomain to the IP of the station so that players will show your domain name and not the IP address.

Running As A Service

The best thing to do is to automate the playlist and server fully by installing them as Windows Services and setting them to start automatically. To do that I'll have to pay $5 for an MP3 encoding license and go through the details with the transcoder: http://wiki.winamp.com/wiki/SHOUTcast_DNAS_Transcoder_2. After that I can install the server and transcoder as services with the correct settings file specified to authorize me and use MP3 encoding. This will allow the server to run in isolation from my connection. In the config file I can set the path to a playlist saved with the .pls extension made in Winamp on the server.

Install

PS> cd “C:\Program Files\SHOUTcast”
PS> .\sc_serv.exe install sc_serv 0 0 .\sc_serv.conf
PS> .\sc_trans.exe install sc_trans 0 0 .\sc_trans_basic.conf

Uninstall

PS> cd “C:\Program Files\SHOUTcast”
PS> .\sc_serv.exe uninstall sc_serv 
PS> .\sc_trans.exe uninstall sc_trans 

The MP3s

As for the music, I am making a station. This station will run MP3s from artists who have given me permission to allow downloading of their songs. Additionally it will rebroadcast podcasts from other websites. This means I can play music that I have right to play on my station, adding new songs to the VPS through remote desktop and letting the randomization of Winamp take care of the rest.

DJing

When I think about radio I think there are DJ's, live broadcasting. The great thing is that this is not difficult, just add the dj config settings to the transcoder config file and open the ports required on the server. After that the Winamp plugin allows live DJing, just press to talk. I've made an automated playlist of podcasts and can chime in when I want.

Conclusion

In this article I have set up a SHOUTcast server with an automated playlist and have left open the option to do live streaming through Winamp when I want. This allows 24/7 music playing, if the server restarts it will just restart the services and keep on playing music. If I want to play music on a playlist I have or stream from a microphone, that's an option as well. I can go to the SHOUTcast page for my radio and see how many listeners I have and that it's working whenever I want.

Questions

I was able to get answers to almost all of my questions on the SHOUTcast forum. If you have questions, go there.

Comments

No Comments

Post Comment

Prove you are human 5 + 7 =

Tagged: PowerShell


Join my email list!



ryan
About Me

With over 15 years in tech, I've excelled as a senior software engineer, specializing in ASP.NET, C#, SQL, Azure, and front-end technologies. I've led diverse projects across various sectors, from startups to global corporations, particularly during my decade in the San Francisco Bay Area.


Sign Up With SoftSys Hosting! (My host)