How to rip CDs and stream their contents
Why should you do it?
Because you want to listen to ALL your favorite CDs WITHOUT changing them, anywhere in the house, or even outside yur house as long as there is a computer connected to your network or Internet
Because you want to create your own playlists with your favorite songs, in a certain order
Because you are afraid your CDs are getting old … or scratched … or lost
Because you want to show off and brag about it
Because it is easy
Because we help IT.
What do you need ?
A computer running Unix ( or Windows and free VMWARE server )
The following applications ( see references for a links to their download pages )
Rip + lame + cdparanoia
Icecast
Ices
Winamp
About 30 min to configure it all
About 20 min per CD for ripping process ( it can be unattended )
How can you do it ?
Here is simplified process, for details and examples, please look further down the page
- Install all applications
- Configure icecast ( pick a port, passwords and mountpoints)
- rip CDs
- adjust/modify/create playlists
- configure ices to read the playlist ( playlist location, port, mountpoint )
- start icecast and ices
- optional, open the icecast port in your firewall so you can listen to your music from anywhere over the Internet
- start Winamp and “play URL”
How can you do it …in details ?
- install all application
You can download from below links, compile and install them or use whatever
update program is available on your Unix machine ( yum for Redhat/Fedora, apt-get for Debian/Ubuntu …etc )
Installing rip is just a matter of untar it and copy it somewhere in your PATH
Make sure you also install the perl modules needed by rip
cd /tmp; tar zxvf rip-1.07.tar.gz
cp /tmp/rip-1.07/rip /usr/local/bin
tar zxvf CDDB_get-1.66.tar.gz
cd CDDB_get-1.66; perl Makefile.PL; make; make install
cd .. ; tar zxvf MP3-Info-0.91.tar.gz
cd MP3-Info-0.91 ; perl Makefile.PL; make; make install
- Configure icecast ( pick a port, passwords and mountpoints)
Icecast uses an xml configuration /usr/local/etc/icecast.xml
At minimum, you will have to modify port, mountpoint, passwords and owner
( the ones in CAPITALS below)
<listen-socket>
<port>PORT_NUMBER</port>
<shoutcast-mount>/MOUNT_POINT</shoutcast-mount>
<listen-socket>
<authentication>
<!-- Sources log in with username 'source' -->
<source-password>SOURCE_PASS</source-password>
<!-- Relays log in username 'relay' -->
<relay-password>RELAY_PASS</relay-password>
<!-- Admin logs in with the username given below -->
<admin-user>admin</admin-user>
<admin-password>ADMIN_PASS</admin-password>
</authentication>
<changeowner>
<user>nobody</user>
<group>nogroup</group>
</changeowner>
Note
PORT_NUMBER should be a number between 8000 and 65,000
Please make sure you wont use some already allocated ( for example 10000 which is used by webmin ). A safe rage is 8000 to 8050.
MOUNT_POINT will be used by icecast and be part of the URL
It make sense to use something meaningful and short
Good examples are “/classic” , “/jazz”, “/party”
Avoid using special characters and spaces, keep it simple
Changeowner this should be the least privileged user, “nobody” is usually available on all Unixes, you could also create your own.
3. rip CDs
My preferred command for ripping CDs to mp3 files is
rip –L –S –m /my_mp3_folder
This creates a folder /my_mpe_folder/ArtistName/AlbumName as well as a playlist
Ripping a CD takes about 15 minutes
- adjust/modify/create playlists
If you have the playlists created already by using the above method, you could use them individually or concatenate them so more than one album can be played
Cd /my_mp3_folder
Cat playlist1 playlist2 playlist3 > my_concatenated_playlist
Another option is to search for mp3 files and create a list with the ones you found
find /my_mp3_folder –name “*.mp3” > playlist.m3u
You will run into problems if you have mp3 files with spaces in their names
I have provided under references a script that can be used to replace spaces with underscores
Save it as /usr/local/bin/remove_space.sh and use it as follows
find /my_mp3_folder -depth -exec /usr/local/bin/remove_space.sh {} \;
- configure ices to read the playlist ( playlist location, port, mountpoint )
ices is also using xml configuration file
To avoid confusion, I’ve installed mine in /usr/local2 instead of /usr/local
You will need to create one config for each mountpoint - this way you could use the same port for as many mountpoints/ playlist as you want
<Playlist>
<File>/my_mp3_folder/playlist.m3u</File>
</Playlist>
<Server>
<!-- Hostname or ip of the icecast server you want to connect to -->
<Hostname>xxx.xxx.xxx.xxx</Hostname>
<!-- Port of the same -->
<Port>PORT_NUMBER</Port>
<!-- Encoder password on the icecast server -->
<Password>SOURCE_PASS</Password>
<Mountpoint>/MOUNT_POINT</Mountpoint>
<!-- The name of you stream, not the name of the song! -->
<Name>IhelpIT favorites</Name>
<!-- Genre of your stream, be it rock or pop or whatever -->
<Genre>Default genre</Genre>
<!-- Longer description of your stream -->
<Description>Default description</Description>
</Server>
Note
CAPITALIZED variables have to be the same for icecast as well as ices
- start icecast and ices
icecast -b -c /usr/local/etc/icecast.xml
/usr/local2/bin/ices –B -c /usr/local2/etc/ices.fav2.conf
- start Winamp and “play URL”
Your URL to be entered in Winamp will look something like this
http://xxx.xxx.xxx.xxx:PORT_NUMBER/MOUNT_POINT
http://192.168.0.22:8001/classic
References
http://rip.sourceforge.net/
http://sourceforge.net/projects/lame/
http://www.xiph.org/paranoia/
http://www.icecast.org/
http://www.icecast.org/ices.php
http://www.winamp.com
http://nooss.org/wiki/Icecast_at_home
remove_spaces.sh script
#!/bin/bash
#
# Writen by Mayuresh Phadke (mayuresh at gmail.com)
# To change the names of all files in a directory including directory names
# run the command
#
# find . -depth -exec ~/rename.sh {} \;
#
# This command is pretty useful if you have a collection of songs or pictures transferred
# from your windows machine and you are finding it difficult to handle the
# spaces in the filenames on UNIX
#
set -x
progname=`basename $0`
if [ $# != 1 ]
then
echo "Usage: $progname \"file name with spaces\""
echo
echo "This utility is useful for renaming files with spaces in the filename. Spaces in the filename are replaced with
_"
echo "\"file name with spaces\" will be renamed to \"file_name_with_spaces\""
echo
exit 1
fi
old_name=$1
dir=`dirname "$1"`
file=`basename "$1"`
new_file=`echo $file|sed "s/ /_/g"`
new_name=$dir"/"$new_file
if [ "$old_name" != "$new_name" ]
then
mv "$old_name" "$new_name"
fi
exit 0
