LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 07-20-2008, 06:01 PM   #1
whowalks
LQ Newbie
 
Registered: Jul 2008
Posts: 4

Rep: Reputation: 0
Command line tool for recording audio and cutting on the fly


Hi.

I'm trying to record some (HAM) radio conversations conecting the radio to the Line-in jack using sox.
I've managed to record only when there is something to record (ignoring silences) with sox.

But sox only records on a sigle file.
Is there some command line software to record audtio, ignoring silence and also creating a new file each time it detects sound ?

Thanks

Camilo.
 
Old 07-22-2008, 06:59 AM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
If you have an existing mp3 or ogg file which you want to split into chunks, you can use mp3splt with the -s option, but I don't know if this is possible on the fly.
 
Old 07-22-2008, 07:04 AM   #3
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Incidentally, I have a problem you might be able to help with. I tried to make recordings from my icon r5 receiver using my computer, but when I connect it to my computer, the sensitivity of the receiver drops terribly.

I'm just connecting the headphone jack into the line in on my computer sound card.

I suspect I should actually be having some extra components on the connecting wire (impedance matching?), but I don't know what I should do to improve it. Is that a typical problem?

I should point out that I know essentially nothing about audio electronics and radio stuff. I'm not a ham, although maybe one day I will try for the exam.
 
Old 07-22-2008, 02:33 PM   #4
whowalks
LQ Newbie
 
Registered: Jul 2008
Posts: 4

Original Poster
Rep: Reputation: 0
when you refer to receiver sensitivity, it means radio signal or sound .. ?
Because I was'n able to record sound until I used a monophonic cable.

And sorry if i've given the wrong idea, but I'm not a ham, I'm just trying to record a company's radio frequency used for it's vehicles.


Quote:
Originally Posted by matthewg42 View Post
Incidentally, I have a problem you might be able to help with. I tried to make recordings from my icon r5 receiver using my computer, but when I connect it to my computer, the sensitivity of the receiver drops terribly.

I'm just connecting the headphone jack into the line in on my computer sound card.

I suspect I should actually be having some extra components on the connecting wire (impedance matching?), but I don't know what I should do to improve it. Is that a typical problem?

I should point out that I know essentially nothing about audio electronics and radio stuff. I'm not a ham, although maybe one day I will try for the exam.
 
Old 07-22-2008, 02:37 PM   #5
whowalks
LQ Newbie
 
Registered: Jul 2008
Posts: 4

Original Poster
Rep: Reputation: 0
I've tried mp3plt before posting the question, and got this error.
something like this.

-s and -c option cannot be user with -k , input must be seekable

I've found this perl library,
Audio::FindChunks
Wil try it to se if it can do the work.


Quote:
Originally Posted by matthewg42 View Post
If you have an existing mp3 or ogg file which you want to split into chunks, you can use mp3splt with the -s option, but I don't know if this is possible on the fly.
 
Old 09-10-2008, 01:41 PM   #6
devmoc
Member
 
Registered: Sep 2005
Posts: 38

Rep: Reputation: 15
Did you find anything to solve your problem? I have exactly the same problem. Thanks.
 
Old 09-11-2008, 08:29 AM   #7
whowalks
LQ Newbie
 
Registered: Jul 2008
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by devmoc View Post
Did you find anything to solve your problem? I have exactly the same problem. Thanks.
Still no luck. I was thinking in edit the source code of sox, but my project was cancelled so I did not continue searching.
 
Old 09-11-2008, 11:52 PM   #8
devmoc
Member
 
Registered: Sep 2005
Posts: 38

Rep: Reputation: 15
I actually just discovered today a method that works really well. Try this and let me know if it works for you.

First setup alsamixer to record the Line-In, check your levels and so forth.

Code:
arecord -D plughw:0,0 -f S16_LE -c1 -r22050 -t raw | lame -r -s 22.05 -m m -b 64 - FILE.mp3
That particular command will give you a single output mp3 file with 22050 Hz sampling, mono, 64 kbps. You can adjust it to your needs of course, check the man pages for arecord and lame.

Code:
mp3splt -s -p th=-30,min=1,rm FILE.mp3
The command above will take the mp3 file and split it into multiple tracks based on a silence threshold (th) of -30 dB, a minimum (min) silence duration of 1 second, and remove (rm) the silence from the split tracks.

You'll end up with a directory full of "Track **.mp3" files. Then remove or rename any other files in the directory and do the following.

Code:
mpgjoin *.mp3 -o JOINED.mp3
This has been working for me on the tests I've performed so far. Hopefully this helps someone, because I've searched high and low for many months and came to the conclusion that there is about 5 of us in the English speaking world that want to do this, and none of us could figure out a way of doing it.
 
Old 09-11-2008, 11:59 PM   #9
devmoc
Member
 
Registered: Sep 2005
Posts: 38

Rep: Reputation: 15
Also, I just wanted to point out that you can limit the recording to a certain amount of time by adding "-d xxx" to the arecord line, where "xxx" is the duration in seconds.

Code:
arecord -D plughw:0,0 -f S16_LE -c1 -r22050 -t raw -d 1800 | lame -r -s 22.05 -m m -b 64 - output.mp3
That would record for 30 minutes.

This can also be cron jobbed.
 
Old 11-07-2008, 02:46 PM   #10
kdobrev
LQ Newbie
 
Registered: Aug 2008
Posts: 3

Rep: Reputation: 0
@whowalks
Can you please, post the command for sox to skip silences in an audio file.
The thing that you managed to do, but wasn't right for you.
 
  


Reply

Tags
audio, recording, sox



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
where is the ffmpeg command line tool? leodemario Linux - Desktop 5 02-25-2007 03:11 PM
Audio mixer - commnd line tool RGummi Linux - General 3 01-17-2007 12:42 PM
DHCP command line tool cold Fedora 1 11-09-2005 10:14 AM
can i use this line for audio recording? tacca Linux - Hardware 0 10-23-2004 09:53 AM
Recording audio through line-in doesn't work. dowski01 Fedora 0 08-06-2004 07:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:35 PM.

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