What to use for saving to mp3/ogg while recording?

Support & discussion regarding DAWs and MIDI sequencers.

Moderators: MattKingUSA, khz

Post Reply
wolftune
Established Member
Posts: 1350
Joined: Fri Feb 24, 2012 7:40 pm
Location: Portland, OR
Been thanked: 2 times
Contact:

What to use for saving to mp3/ogg while recording?

Post by wolftune »

On my Mac, I use Amadeus Pro to record long audio files and save to mp3 while recording. It's basically like a voice-memo feature. The idea is simply that a 45 minute recording saved directly to mp3 on the fly results in a small finished file right when stopping. For some purposes, that is much better than holding it all in WAV format or RAM or whatever and then having to export the huge file later. It takes a few minutes to translate a 45-minute WAV file into mp3. So I want save-to-mp3-while-recording.

Anyone have suggestions as to how to accomplish this in Linux?
Aaron Wolf
Music teacher, scholar
http://wolftune.com
slowpick
Established Member
Posts: 457
Joined: Mon Apr 25, 2011 10:09 am

Re: What to use for saving to mp3/ogg while recording?

Post by slowpick »

http://packages.debian.org/unstable/sound/jack-capture

http://traverso-daw.org/Features.html this should work.

Reaper can record and render, and I think krecord and Gnomes system recorder can.

Podcast utilities usually can record: http://code.google.com/p/darkice/

even a skype recorder http://www.youtube.com/watch?v=7NZjala-LZU
Riches!
wolftune
Established Member
Posts: 1350
Joined: Fri Feb 24, 2012 7:40 pm
Location: Portland, OR
Been thanked: 2 times
Contact:

Re: What to use for saving to mp3/ogg while recording?

Post by wolftune »

wow, thanks, SP! I wasn't so optimistic... My only disappoint with Linux so far is not being able to run a couple specialty programs (EDIT: Melodyne mainly), but everything else seems to be superior to my old system!
Last edited by wolftune on Mon Mar 05, 2012 2:28 pm, edited 1 time in total.
Aaron Wolf
Music teacher, scholar
http://wolftune.com
Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: What to use for saving to mp3/ogg while recording?

Post by Pablo »

I also recommend jack_capture. I think it is the right tool for your description.

It can record directly to mp3 and ogg (and flac and wav) and it autoconnects to its inputs every jack audio port which is connected to the "system playbacks", so you literally record what you are hearing trhough the speakers from the moment you press the Record button.

It can be run in the command line. For example, you can open a terminal and just write:

jack_capture -mp3

Press Enter and you have it up and running recording in a file called jack_capture001.mp3 in your home directory. Of course, you can do something like:

jack_capture -mp3 -fn myfilename.mp3

It also has a gui frontend, called jack_capture_gui2, with a big red button and some options to choose from.

Now, after testing my own words, I have to tell you the bad news:

I see that jack_capture from KXstudio doesn't install the gui front-end and it doesn't record to mp3 either. However, it can record to ogg from the command line. For example:

jack_capture -f ogg

works as expected.

You can also, tell jack_capture to stop recording after, say, 45 minutes (2700 s):

jack_capture -f ogg -d 2700 -fn mysession.ogg

To have a view of all the options, type:

jack_capture --advanced-options

If you are interested, I will look into this to compile jack_capture with the mp3 option and the gui in my ubuntu system and I will give instructions (assuming I success, I hope so).

But if you make do from the CLI and the ogg format, go for it. Needless to say, it doesn't work if jack is not active.

Cheers, Pablo
Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: What to use for saving to mp3/ogg while recording?

Post by Pablo »

My only disappoint with Linux so far is not being able to run a couple specialty programs (Musescore mainly)
Really? What is the problem with musescore? (new thread, please)
wolftune
Established Member
Posts: 1350
Joined: Fri Feb 24, 2012 7:40 pm
Location: Portland, OR
Been thanked: 2 times
Contact:

Re: What to use for saving to mp3/ogg while recording?

Post by wolftune »

Gracias, Pablo.

Indeed, I think I need to be able to do mp3 so I know my students won't get confused about file formats.

Also, I might like to experiment with something like Audacity's voice-activated recording (which, incidentally, is the first of its type to completely work for me as I expected for input-activated recording after trying dozens of other programs on my mac before). It's definitely not necessary, but I could see using input-activated recording and saving the result on the fly to mp3... I really would prefer ogg, of course, but I have to be practical about the context of others and their formats on their computers...
Aaron Wolf
Music teacher, scholar
http://wolftune.com
wolftune
Established Member
Posts: 1350
Joined: Fri Feb 24, 2012 7:40 pm
Location: Portland, OR
Been thanked: 2 times
Contact:

Re: What to use for saving to mp3/ogg while recording?

Post by wolftune »

Pablo wrote:
My only disappoint with Linux so far is not being able to run a couple specialty programs (Musescore mainly)
Really? What is the problem with musescore? (new thread, please)
Agh. Nevermind this. Brainfart. I meant MELODYNE can't run under Linux!
Aaron Wolf
Music teacher, scholar
http://wolftune.com
Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: What to use for saving to mp3/ogg while recording?

Post by Pablo »

Hi,

You also might like jack Timemachine. It is cool. The description, from http://plugin.org.uk/timemachine/

"I used to always keep a minidisc recorder in my studio running in a mode where when you pressed record it wrote the last 10 seconds of audio to the disk and then caught up to realtime and kept recording. The recorder died and haven't been able to replace it, so this is a simple jack app to do the same job. It has the advantage that it never clips and can be wired to any part of the jack graph.

The idea is that I doodle away with whatever is kicking around in my studio and when I heard an interesting noise, I'd press record and capture it, without having to try and recreate it. :)"


I sometimes use timemachine to record the radio retrospectively. After listening to something interesting enough, I press record and voilà, it's not lost :)

The installation is a no-brainer: Software Center and you are done. The tricky thing here is that, by default, it records to w64 format. Audacity can open these files. If you want wav format, then you have to change the default command. "timemachine --help" or "man timemachine" will tell you. Then you go edit the launcher command. You want to append "-f wav" for wav files.

Unfortunately, this does not encode to mp3 on the fly. However, you can encode to mp3 from wav much faster and easier than, for example, via Audacity, by means of a bash script. For example, you can use lame in a loop with a shell script like this one, or similar:

#!/bin/bash
# wav2mp3
for i in *.wav; do
lame -h -b 320 "$i" "${i%.wav}.mp3"
done

So you just have to open a terminal in a folder where you have the wav files and write "wav2mp3", and all the files are converted to mp3 320 kps, after a while, without more interaction needed.



Now, how to have jack_capture with a gui and converting to mp3 on the fly.

1) Install the compiler and needed development libraries:

sudo apt-get install build-essential libjack-dev libasound2-dev libmp3lame-dev libvorbis-dev libflac-dev

(I think this will do it, but I am not sure. Take a look at the output of "make" for any errors, see below)

2) Download the source code and extract it:

The files are here:
https://github.com/kmatheussen/jack_capture

You can get them by running:

sudo apt-get install git
git clone https://github.com/kmatheussen/jack_capture

3) Now, compile:

cd jack_capture
make
make jack_capture_gui2 (this gives a lot of warnings, but it seems to work here).
sudo make install
sudo cp jack_capture_gui2 /usr/local/bin

Now type in the terminal "jack_capture_gui2". If you are happy with it, create a launcher with this command, so the next time you just have to click once.

I just saw that, according to the README file, jack_capture_gui2 is not maintained anymore. However, it seems to work. Anyway, as I said earlier, you just have to write in a terminal:

jack_capture -mp3

and you start recording what you are hearing through the speakers. Of course, you still can use jack_capture without the autoconnect option and record from whatever jack port.

Cheers, Pablo
wolftune
Established Member
Posts: 1350
Joined: Fri Feb 24, 2012 7:40 pm
Location: Portland, OR
Been thanked: 2 times
Contact:

Re: What to use for saving to mp3/ogg while recording?

Post by wolftune »

Ok, I'm having some errors with the jack capture GUI, and I haven't figured out how to make jack capture connect to the computer's microphone instead of to the system output...

terminal jack_capture works for system output.

also mp3 capture gives a lame error: "mp3 not supported. liblame was not installed when compiling jack_capture" although I have lab installed according to software manager...
Aaron Wolf
Music teacher, scholar
http://wolftune.com
Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: What to use for saving to mp3/ogg while recording?

Post by Pablo »

Did you try to compile jack_capture and jack_capture_gui2? In this case, what are the outputs of "make" and "make jack_capture_gui2" ?

Note that, unfortunately, jack_capture package from KXstudio repos doesn't have mp3 support. it doesn't install jack_capture_gui2 either.

As for the first issue (no mp3 support) you could make a feature request to falktx. The NO GUI issue is a bit trickier, because the upstream developer is not maintaining it anymore.

To record a stereo file from the soundcard:
jack_capture -c 2 -p system:capture*

To record a mono file the soundcard, input 1:
jack_capture -c 1 -p system:capture_1

To not autoconnect, so you can make the desired connections afterwards via qjackctl, patchage...

jack_capture -mc

Cheers, Pablo
wolftune
Established Member
Posts: 1350
Joined: Fri Feb 24, 2012 7:40 pm
Location: Portland, OR
Been thanked: 2 times
Contact:

Re: What to use for saving to mp3/ogg while recording?

Post by wolftune »

I had the GUI working right away, but hitting record didn't successfully get a real recording and the settings didn't stick.

The terminal commands are fine, but I still don't know how to record an input instead of output. I want to record mic-in...
Aaron Wolf
Music teacher, scholar
http://wolftune.com
Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: What to use for saving to mp3/ogg while recording?

Post by Pablo »

Hi wolftune,

You want to record mic-in, from which audio card? Is jack using it?

Anyway, please, show the outputs of

cat ~/.jackdrc /proc/asound/cards
arecord -l && aplay -l

This will list your jack settings, audio cards and devices. With this info, I hope I will able to help you better.

Cheers, Pablo
Post Reply