Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-08-2010, 01:07 PM   #1
LQ Newbie
Registered: Oct 2010
Distribution: Ubuntu 10.04
Posts: 16

Rep: Reputation: 0
Question Automated Audio Recording

I had been wondering how to set up an automatic scheduled recording of my favorite radio talk show. I was even more encouraged when I found it streaming live on the net. So I started looking for a way to do this when I came across this thread: . It is just what I had been looking for! I set it up close to the instructions. I ran a test and everything seemed to be going great. Firefox opened up to the correct link and I could hear the audio, next a new file appeared on my desktop as I was expecting/hoping. Well, the show ended and Firefox shutdown and the file on my desktop had been renamed as per the script. I was ecstatic!
So I went to check out the quality of the audio and was disappointed to find that no audio was playing as far as I could tell. I checked the files properties to find that it was a hefty 477.9 MB. About right for what I set up. So then I opened it in Audacity to check the waveform: . I tried amplifying the track, but all I got was dead air with a few crackles. I tried posting this in ubuntuforums, but so far I haven't gotten any good leads. So I figured maybe someone here might be able to help.

This is my settings for this task;

crontab is setup as so:
# m h dom mon dow command
#Record the radio show everyday
#Open firefox and load the audio stream
03 11 * * 1,2,3,4,5 export DISPLAY=:0 && firefox
#Record every day from 11:06am for 2 hours and 54 minutes
05 11 * * 1,2,3,4,5 arecord -d10440 -r24000 -c2 /home/zer0/Desktop/radio-show.wav
#Rename the audio file by placing a time stamp on it
01 14 * * 1,2,3,4,5 /home/zer0/rename-radio-file
#close all instances of firefox
01 14 * * 1,2,3,4,5 killall -q firefox-bin

The bash script is:
#Program to rename a file with a date stamp.

mv /home/zer0/Desktop/radio-show.wav /home/zer0/Desktop/rshlmbgh-$(date +%Y%m%d).wav
Old 10-08-2010, 01:09 PM   #2
LQ Newbie
Registered: Oct 2010
Distribution: Ubuntu 10.04
Posts: 16

Original Poster
Rep: Reputation: 0
Once I can get the audio issues worked out, I would like to have it automatically convert the .wav file to a .mp3.
Also, I'd like the shutdown of Firefox to be more specific instead of killing ALL instances of FF.
Any assistance is greatly appreciated!
Old 10-09-2010, 03:09 AM   #3
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493

Rep: Reputation: 50
For what I know, arecord will record from your sound-card input...
Use VLC for this purpose with something like "vlc rtsp://$STREAM_URL --sout ???:$FILE"
And the good point is that I'm quite sure vlc can encode the file on the fly. If not automatically converting a wav into ogg is straightforward, use "oggenc", and if you really prefer mp3, use "lame"
Old 10-09-2010, 03:16 PM   #4
LQ Newbie
Registered: Oct 2010
Distribution: Ubuntu 10.04
Posts: 16

Original Poster
Rep: Reputation: 0
Thanks so much for the advice! I will definitely look into this. .ogg is fine with me as well, and I already have lame...either way. The last "help" I got suggested Audacity, but the timed recording options were very limited. Another suggested nMacro running under Wine. I'm not sure how well that would work, but I really want all this to happen from the command line instead of a GUI. I'm trying to get more experience with doing things from the CLI. This is my first experience with cron. Lol

Now if I can kill Firefox more specifically...
Old 10-10-2010, 12:22 PM   #5
LQ Newbie
Registered: Oct 2010
Distribution: Ubuntu 10.04
Posts: 16

Original Poster
Rep: Reputation: 0
vlc rtsp://$STREAM_URL --sout ???:$FILE

I hate to ask, but could you please elaborate on this command?
I understand "$STREAM_URL" but the rest is a little cryptic to me.
I am assuming "--sout" is "sound output", the "???" eludes me and "$FILE" is the name of the file, correct? Will naming the file with an extension like xxx.ogg or xxx.mp3 enact the conversion process?

Last edited by zer010; 10-10-2010 at 12:28 PM.
Old 10-10-2010, 12:43 PM   #6
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,236

Rep: Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914
these might get you more mileage:
mplayer -dumpstream -dumpfile smoothjazz.mp3
ffmpeg -i -ab 128 -ar 44100 smoothjazz.mp3


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need advice on automated recording software yeager Linux - Software 3 04-05-2010 03:02 PM
no audio recording from tvcard SharpyWarpy Linux - Hardware 4 09-08-2005 08:01 AM
Audio Recording. svendabassist Linux - Software 1 02-04-2005 12:08 AM
Recording Audio-in Dirk the Daring Linux - General 0 12-23-2004 11:43 AM
need help recording audio havokok Linux - Software 0 03-03-2004 08:41 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:53 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration