20110902

Using Lame to convert a set of WAV files to MP3

While cleaning up my temp directory today, I stumbled across some old .wav files from a CD I had ripped a couple of months earlier. I don't know why I didn't originally rip them to MP3 since I was using EAC, but I needed to free up space. I already owned the CD, and didn't want to have the uncompressed audio files taking up space on my laptop.

Machine: Windows XP SP3
Issue: Need to convert several WAV files to MP3
Gripes: Don't want to do it one-at-a-time, or use a GUI; must be "scriptable."
Tool of choice: Lame, for /f

Command:

for /f "usebackq delims=" %g in (`dir /b d:\drop\aud\*.wav`) do @%programfiles%\lame\lame.exe -b 192 -h "d:\drop\aud\%g" "d:\dl\aud\%g.mp3"

Notes:
  • Use this raw when copying directly to prompt. If putting in a .bat or .cmd file, remember to change all instances of %g to %%g.
  • Also, the quotes immediately inside the parentheses are backquotes, usually on the same key as your tilde (~) character in the upper left-hand corner of your keyboard.

Other Gripes:
  • This is obviously very rudimentary, as it doesn't strip the .wav off the end first; it just creates a .wav.mp3 file which you would then have to rename.
  • If you want to script that out, you could do so as follows:
    set originalFile=%%g:.wav=%
    That searches the %g iterative variable for the .wav and strips it off, assigning the result to originalFile.

My blog doesn't currently get much traffic, but if there's any interest later, I'll add a full script to do this.

20110819

How forums can help you realize you're being an idiot.

I love it when I'm researching a problem I've been having, and I suddenly find a forum whereby someone has posted the same issue. If it's a complicated fix, people are usually nice enough to provide assistance, but occasionally there are no answers posted; the thread will just _die_.

Want to know why that happens? It's because you're either overthinking the problem, or you didn't RTFM. Go back and think about the problem, read the documentation, and then take a step back. You've missed something, and it's right there in front of you.

Yeah, I know. I do it, too. Welcome to the club.

20110729

Visual copy verification using TeraCopy

I've been using TeraCopy on my Windows machines for years now, and have been very pleased with it. After copying a few files and then Verifying the CRCs on each, it occurred to me that I also wanted to check the other files I had copied earlier.

To do this, all you have to do is choose to TeraCopy the set again, but tell it to Skip All. When the summary window pops up, just hit [Verify] at the bottom and TC will take care of the rest.

I frequently use md5sum and fc to check for copy consistency, but this is a nice, colorful alternative.


Not using TeraCopy yet? You're missing out. Download it here from CodeSector, or here from CNet.