Audio Streaming in Ubuntu using Shoutcast and Internet DJ Control

     If you ever want to stream your rails application audio file using shoutcast I will show you how to do this

firt install and configure shoutcast
cd /tmp
wget http://download.nullsoft.com/shoutcast/tools/sc_serv_1.9.8_Linux.tar.gz

If you get error while trying to execute this command then you don’t have wget command installed to your system. For Debian and Ubunutu use the following command to install it:

Code:
apt-get install wget

Again If you get the error then go to the shoutcast site then download the package

 Next we need to create the folder for our shoutcast server and extract the archive

Code:
mkdir /home/shoutcast
tar -zxf sc_serv_1.9.8_Linux.tar.gz -C ./home/shoutcast

Navigate to the shoutcast folder and clear the config file because it has comments and configuration codes it may confuse you if you see them first time any way its better to clear the file

Code:
cd /home/shoutcast
echo > sc_serv.conf

5. Open the file sc_serv.conf

Code:
nano sc_serv.conf

Paste the following text

Code:
 MaxUser=32
 Password=changeme
 PortBase=8000
LogFile=sc_serv.log
RealTime=1
ScreenLog=1
ShowLastSongs=10
SrcIP=ANY
DestIP=ANY
Yport=80
NameLookups=0
 AdminPassword=adminpass
AutoDumpUsers=0
AutoDumpSourceTime=30
PublicServer=default
AllowRelay=Yes
AllowPublicRelay=Yes
MetaInterval=32768

You should modify these settings:

A. Change the MaxUsers , It can be many users but set minimum as possible
B. Set the Password to a value that you know because you need it to connect to the server in order to stream music to it.
C. Optionally you can change the port by changing the PortBase to some different port.
D. AdminPassword is the web interface password. Web interface is used for banning and kicking users from the server.

6. Start the server

Code:
screen
./sc_serv

Thats all next is to go for broadcaster software in windows and mac SAM broadcaster is a excellent software we have but If you  want to use ubuntu then InternetDJcontrol shortely called as IDJC

IDJC

first we need to install idjc

Code:

sudo apt-get install jackd qjackctl

then

Open Limits.conf

sudo gedit /etc/security/limits.conf

Add the following lines into the file :

@audio - rtprio 99
@audio - memlock unlimited
@audio - nice -19

then run idjc you can find it by searching IDJC in ubuntu search bar This is GUI of IDJC

 main

Go to view-> output you will see the window like this there go to configuration -> connection -> new and fill the details as shown then click OK

host

then in configuration -> format fill the details as follows

configuration image

configuration setting

If all set to correct then above localhost:8000 (8000 may change depends on port you set)  will appear as shown if not check the settings againlocalhost then click the localhost:8000 button if everything goes well the button has need to be stayed as pressed like this  then the green light will glow

connectedand that’s all you may listen your radio on shoutcast.com by searching your radio name which you given at the first time you starts the IDJC , if the green indicator doesnot glow check the shoutcast server running and see the serv.conf file port setting

If you want to use it in your rails application the jplayer fetch the stream and play it well check it on their website jplayer stream player

 

Thank you for reading me…………………

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s