Archive for October, 2009

convert folder wav to mp3

Monday, October 12th, 2009

1.a. convert wav folder into mp3 folder; use 64kb quality; should result in not too big files:

liberty@liberty-desktop:~/200909/sprueche/xml$ for f in *.wav; do lame -V 4 -b 64 "$f" "converted/${f%.wav}.mp3"; done

the result is here: /home/liberty/200909/sprueche/xml/converted

1.b. lower quality: $ for f in *.wav; do lame -V 6 -b 48 "$f" "converted/${f%.wav}.mp3"; done

2. convert wav folder to ogg: liberty@liberty-desktop:~/200909/sprueche/store$ for f in *.wav; do sox "$f" -t ogg -r 11025 -c 1 "converted/${f%.wav}.ogg"; done

convert folder flac to wav with sox

Sunday, October 11th, 2009

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