convert folder flac to wav with sox

the following command converts a flac file into a wav file

liberty@liberty-desktop:~/200910/test/ralfherzog/VoxForge$ for f in *.flac; do sox "$f" "${f%.flac}.wav"; done

which tags can be added? want to convert from 48k to 16k unsigned PCM

this worked, too: liberty@liberty-desktop:~/200910/test/ralfherzog/VoxForge$ sox http://script.blau.in/german/01/de1-02.flac -t flac -r 16000 -s -c 1 target02flac

what should it look like? try
$ for f in *.flac; do sox "$f" -t wav -r 16000 -s -c 1 "${f%.flac}.wav"; done

the following works, converts a 48k flac to 16k wav: liberty@liberty-desktop:~/200910/test/ralfherzog/VoxForge$ for f in *.flac; do sox "$f" -t wav -r 16000 -s -c 1 "${f%.flac}.wav"; done

the following works for storing in a subfolder: $ for f in *.flac; do sox "$f" -t wav -r 16000 -s -c 1 "subfolder/${f%.flac}.wav"; done

you can store an ogg file in a subfolder: $ for f in *.flac; do sox "$f" -t ogg -r 16000 -c 1 "subfolder/${f%.flac}.ogg"; done
it seems that this ogg file has 48k not 16k as intended. why is that? no, it has 48kbps, and 16000 hertz, so probably all right. the -s option can't be used in conjunction with ogg because "can't encode Signed Integer PCM"

this converts 48k flac files to 16k flac files into a subfolder: $ for f in *.flac; do sox "$f" -t flac -r 16000 -c 1 "subfolder/${f%.flac}.flac"; done
the -s option can't be used with flac files

converted successfully the german prompts01 from 48k flac to 16k flac: liberty@liberty-desktop:~/200910/editing-ralfherzog/01$ for f in *.flac; do sox "$f" -t flac -r 16000 -c 1 "converted/${f%.flac}.flac"; done

Comments are closed.