Command line tool for recording audio and cutting on the fly
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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 ?
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.
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.
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
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.
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
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.