Do you like to listen to music or news? Are you a Linux user? If yes, this project may interest you.
This project shows you how to implement your own on-line radio receiver in Linux, using as major basis the mplayer application. Mplayer will operate in slave mode and receive commands by named pipes. It's possible to make this project work both in embedded and non-embedded Linux. It means that, if your Linux system has audio output, it's able to run Python scripts and runs mplayer application, you're ready to implement it easily.
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Python Checking
Before implementing this project, some preparation is necessary.
Be sure your Python version is 2.7 (for later versions, please check compatibility of functions print and raw_input).
Step 2: Installing Mplayer
sudo apt-get install mplayer2
Step 3: Choosing On-line Radios
Now it's time to choose the on-line radios to listen to.
A very good website to get some radios is Shoutcast.
Especifically to this project, the on-line radio's URL must be a .pls playlist file. Here are three examples of valid on-line radio's URLs:
Step 4: Testing Mplayer
To ensure your mplayer is ok, it must be tested in playing on-line radio you want to listen to.
To do this, considering on-line radio URL equal http://panel3.serverhostingcenter.com:2199/tunein... type the following command:
mplayer -playlist http://panel3.serverhostingcenter.com:2199/tunein...
Step 5: Talking Is Cheap. Show Me the Code!
Now it's time of coding this project on! The complete source-code sattached here in this step.
To run it, simply type:
Step 6: It's Alive!!!
Now your on-line radio receiver is alive!
Do you want to check this project alive? See these two following videos: