Axel's Blog

A blog about operating systems, software and other interesting stuff

Replay Music- style audio recording in Linux Mint 12 (and *buntu)

One of the last reasons to dual boot into my Windows partition was a tool called Replay Music. RM can record audio from the soundcard, auto split into tracks and get the tags from Gracenote (aka CDDB). This obviously comes handy when you want to digitize your analogue song collection (vinyl records, cassettes, etc.) and I’m sure you can think of other use cases, too … RM is of course a commercial product which supports only Windows and does not even work in WINE, because it uses its own audio driver for recording. So you can imagine my enthusiasm, when I finally stumbled over a solution on how to do this on Linux.

The tricky part of this is the recording … of course you could record song by song using Audacity but there is a more elegant way – directly record to MP3 using the sox command.  Install sox using your favorite package manager (mine’s still Synaptic) and make sure it is set as recording device (there’s a youtube video on how to do this using Pavucontrol). Now enter:

rec -r 44100 -2 -s -p silence 1 0.50 0.1% 1 1:00 0.1% | \
     sox -p song.ogg silence 1 0.50 0.1% 1 3.5 0.1% : \
     newfile : restart

This will split your recording into one file per song, named song001.mp3 to songNNN.mp3, auto- splitting after 3.5 seconds of silence and completely stopping the session after 1 minute of silence. There’s a lot more options documented on the man page, for example you can normalize the output or o a lot of other stuff.

If you have accidentally split a song in 2 or more parts, you can again use Audacity to fix this, or just merge the files using:

cat one.mp3 two.mp3 > merged.mp3

After that you can tag your new MP3s with a tool like Kid3 (always install kid3-qt, the other one has full KDE dependencies). Kid3 supports multi edit and automatic tagging from Gnu/FreeDB, Amazon, TrackTypes, Discogs and MusicBrainz, which in combination gives you a recognition rate even superior to Gracenote.

I tried this on Mint 12, but it should work exactly the same on Ubuntu or Ubuntu- based systems, and at least similar on any other distribution (if the distribution is not using Pulse Audio yet, it might even be easier).

Advertisement

Filed under: *buntu, linux, mint

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

RSS DIASPORA* (via atom2rss)

  • An error has occurred; the feed is probably down. Try again later.

Twitter

Error: Please make sure the Twitter account is public.

Follow

Get every new post delivered to your Inbox.