tuffy / python-audio-tools

A collection of audio handling programs which work from the command line.
http://audiotools.sourceforge.net
GNU General Public License v2.0
249 stars 58 forks source link

Output filename issue: *** Error: output file "track00.wav" occurs more than once #62

Open erikparr opened 8 years ago

erikparr commented 8 years ago

Hello, I want to convert a bunch of flac files in a directory to wav files. I use the following command: track2track --type=wav .flac and I get this error: ** Error: output file "track00.wav" occurs more than once Is there a way to have the output filename be the same as the input filename?

remenor commented 8 years ago

The easiest way to convert flac to wav: Install flac and wrte flac -d * .flac filenames are respected...

If you prefer the hard way, with track2track: the command track2track --type=wav *.flac or track2track -t wav *.flac (the * is a wildcard) converts files but do not select the names

According to the manual

-o, --output=FILENAME An explicit output filename for the converted track. With this option, only a single input track is allowed. It overrides the -d option and the default output filename.

You can be solved with a loop in bash

for FILE in *.flac ; do track2track -t wav "$FILE" -o "${FILE%.*}.wav" ; done

You can make a script with these lines. Sorry for my english