Convert FLAC to WAV w/frontend?

Todd Slater dontodd at gmail.com
Tue Jan 10 13:40:22 UTC 2006


On 1/10/06, Dragon192 <dragon192 at shadowsailor.com> wrote:
> Howdy...

Howdy!


> I am contemplating moving from Windows XP to Ubuntu.  I use the PC to
> convert FLAC files to WAV using FLAC from sourceforge.net with a
> third-party frontend so that I can open the program (frontend) from
> the desktop and convert files in a batch...
>
> What can I use in Ubuntu that will act the same as the Windows setup?
>
> I am new to scripts and command line stuff....I like things easy...(I
> am primarily a Macintosh user and only use the PC for a few odd
> things as well as the aforementioned converting}

Even if you are new to scripts and command line stuff, don't be afraid
of them. Once you get a taste, you'll want more.

The quickest way by far to convert flac to wav is to open a terminal
and go to the directory where your flac's are (cd
/path/to/directory/with/flacs). Now issue the command:

for i in *.flac; do flac -d "$i"; done

The "for i in *.flac" part means for every file ending in .flac.

The "flac -d "$i"" part means to run flac (decode mode) on the
particular flac file in the loop.

If you want to decode an individual file, you'd just run:

flac -d filename.flac

Myself, I put a script called flac2wav in ~/bin.

#!/bin/bash
for i in *.flac
do
flac -d "$i"
done

(you'll notice that's the same as above!)

Just copy/paste that into your favorite text editor and make it
executable (chmod +x filename) and you're good to go.

Now I just change to a directory with flac's and type

flac2wav

and I'm done.

But wait, there's more! With these scripts dumped in the
~/.gnome2/nautilus-scripts folder, you can access them via the file
manager! Here's an example:

#!/bin/bash
for arg
do
flac -d "$arg"
done

Again, copy/paste to your favorite text editor, save to
~/.gnome2/nautilus-scripts/flac2wav, make it executable, and when
you're browsing directories with flac's in nautilus, select a flac or
two or 100, right-click and select Scripts > flac2wav.

HTH,
Todd




More information about the ubuntu-users mailing list