Using a radio capture card to record
Post date: Jan 5, 2010 3:34:20 AM
My HVR-1600 has a built in Radio tuner that I am using to record radio shows like Randy Bachman's Vinyl Tap on CBC radio.
I have a long commute to work so I listen to a lot of shows and music.
I use Vorbis Ogg for all my tunes and my iRiver player likes Oggs too.
So... I grab thew show and ogg it using the following tools:
- fmtools from your distribution repo (apt-get install fmtools) or http://benpfaff.org/fmtools
- ecasound from your distribution repo (apt-get install ecasound) or from http://ecasound.seul.org/ecasound
My audio line out from the HVR-1600 go directly into my Line-In on my soundcard so when I record I have to capture from the LineIn.
You can see in the following command how I specify the input to ecasound is "alsahw,Line,0".
If you need to see what sound devices are available (with their settings)... try:
amixer
You can also use it to set levels and settings from the commandline, for example to unmute the lineIn AND set it as the capure source:
amixer set Line,0 100%,100% unmute capture 2>&1>/dev/null
or to mute
amixer set Line,0 100%,100% mute capture 2>&1>/dev/null
The command I use to tune the channel is
/usr/bin/fm -d /dev/radio1 -T 60 88.3 90 &
The -T 60 is the time in seconds that it tunes & holds the channel for.
The commandline I use to record is:
/usr/bin/ecasound -b 512 -i alsahw,Line,0 -t 60 -o:stdout | /usr/bin/oggenc -Q -q 6 --raw --raw-bits=16 --raw-chan=2 --raw-rate=44100 --raw-endianness 0 -t "TestCBC-Mon Jan 04 2010 (19:41)" -c "TITLE=TestCBC on Mon Jan 04 2010 (19:41)" -d "Mon Jan 04 2010 (19:41)" -c "CITY=North Vancouver" -c "FREQUENCY=88.3MHz" -o "/home/tgutwin/Music/radio/TestCBC_2010-01-04-Mon.ogg" -
Again, notice the -t 60 that specifies the duration of the recording in seconds
don't forget that last '-' to read from stdIn
You also could drop all the vorbis comments so the line looks more like:
/usr/bin/ecasound -b 512 -i alsahw,Line,0 -t 60 -o:stdout | /usr/bin/oggenc -Q -q 6 --raw --raw-bits=16 --raw-chan=2 --raw-rate=44100 --raw-endianness 0 -o "/home/tgutwin/Music/radio/TestCBC_2010-01-04-Mon.ogg" -
Try it out.
You have already probably jumped to the thought of putting this all into a script.
For that see attached