Recording and encoding a radio streaming.
Hello! Today we will see how to record a radio streaming. This tutorial can be used in Linux and Windows because we are going to use tools present in both “OSes”.

The tools used are mplayer and lame encoder. We are going to use the command line version because, in my opinion, a radio streaming is not supposed to be a “once life time event” but a regular event so we have to schedule it.
We have to create two scripts: one for recording and one for encoding.
I will show you the Windows batch files because they’re really tricky (unix shell >> dos shell) and we have to use some workaround.
record.bat:
@ ECHO OFF ECHO Starting recording at: date /T mplayer.exe -dumpstream http://live.mediaserver.kataweb.it/capital
endode.bat:
@ ECHO OFF mplayer.exe -vo null -vc null -af volume=0,resample=22050:0:1 -ao pcm:fast:file="outfile.wav" stream.dump del stream.dump lame.exe outfile.wav outfile.mp3 -V9 -q9 -B128 --lowpass 15 --resample 24 for /f "tokens=1-5 delims=/ " %%d in ("%date%") do rename "outfile.mp3" capitalisti-%%e-%%d-%%f.mp3 del outfile.wav
Just some quick advice:
- the option -af in mplayer is useful if you had to record a really long radio show so you need to resample it in 22.95 MHz beacuse if you don’t use it you will have really big .wav file (in my case a 3 hour long show was 2Giga reduced to 1G resampling).
- my lame configuration is just a try. In that way I can obtain a small file without losing a big amount of quality but my advice is to RTFM lame
It has long been looking for this information, Thank you for your work.
It’s fun. ATP Subscribe to the RCC perhaps