Help - Search - Members - Calendar
Full Version: This script re-encodes all flac files
Hydrogenaudio Forums > Lossless Audio Compression > FLAC
I am all FLAC
This script re-encodes all flac files in the currect directory with your current version of flac, and puts the newly encoded files in a directory "recoded" in the currect directory.

CODE
#!/bin/sh

OUTPUT="recoded"
mkdir $OUTPUT

for f in *flac; do
flac "$f" --best -V -o $OUTPUT/"$f"
done
jcoalson
even shorter:

CODE
mkdir recoded && flac --best -V --output-prefix=recoded/ *.flac
seanyseansean
QUOTE(jcoalson @ Feb 15 2008, 19:41) *

even shorter:

CODE
mkdir recoded && flac --best -V --output-prefix=recoded/ *.flac



But the windows version of flac doesn't support wildcards, or am I wrong?

EDIT: durrr, he's on about the unix version...
I am all FLAC
QUOTE(jcoalson @ Feb 15 2008, 19:41) *

even shorter:

CODE
mkdir recoded && flac --best -V --output-prefix=recoded/ *.flac



Cool! Thanks biggrin.gif biggrin.gif
jcoalson
QUOTE(seanyseansean @ Feb 15 2008, 13:59) *
But the windows version of flac doesn't support wildcards, or am I wrong?
the windows shell (cmd.exe) doesn't support wildcards. flac+bash on windows works fine.
m_l
QUOTE(jcoalson @ Feb 15 2008, 14:41) *

even shorter:

CODE
mkdir recoded && flac --best -V --output-prefix=recoded/ *.flac




How can I get this script to go into all folders in a directory? [recursive]
collector
QUOTE(m_l @ May 6 2008, 21:04) *

How can I get this script to go into all folders in a directory? [recursive]

Use Sweep.exe. Works great. It can be found here at HA; please do a search.


QUOTE(jcoalson @ Feb 15 2008, 15:41) *

the windows shell (cmd.exe) doesn't support wildcards. flac+bash on windows works fine.

CODE
glob.exe -c flac.exe --force -6 -V -S- --delete-input-file *.flac

It's great to use my old DOS. I put this in a batch file and call that with sweep to process it recursively.
m_l
QUOTE(collector @ May 11 2008, 06:41) *


Use Sweep.exe. Works great. It can be found here at HA; please do a search.


CODE
glob.exe -c flac.exe --force -6 -V -S- --delete-input-file *.flac

It's great to use my old DOS. I put this in a batch file and call that with sweep to process it recursively.



Thank You, but I need this for Linux. I'm new to Linux and would write my own script if I knew how.
skamp
CODE
$ man find
$ man xargs
m_l
QUOTE(skamp @ May 11 2008, 13:59) *

CODE
$ man find
$ man xargs




Thank You
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.