ABX<->WAV converter; ABX code modularized, ABX encoder added, direct WAV file io

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3596 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2011-05-04 20:19:27 +00:00
parent ede7d2a545
commit c18134d041
13 changed files with 1925 additions and 315 deletions
+10 -13
View File
@@ -1,26 +1,23 @@
#!/bin/sh
ABX2RAW="./abx2raw"
SOX="sox"
ABX2WAV="./abx2wav"
echo "Converting all abx files in the current directory to wav files."
echo "This script looks for abx2raw in the current dir. If it's somewhere"
echo "else, edit it to point the variable ABX2RAW to the correct location."
echo "The same goes for sox, which is expected somewhere in the path."
echo "This script looks for abx2wav in the current dir. If it's somewhere"
echo "else, edit it to point the variable ABX2WAV to the correct location."
echo "It's just supposed to work once on a specific set of files, and hence"
echo "is pretty fragile."
echo "It is assumed that all abx files have a sample rate of 11025."
echo "If this is not the case, files won't be converted correctly."
echo "The sample rate is reported, so you can see if it goes wrong."
echo "It's also possible that the sample rate changes within one .abx file."
echo "It's possible that the sample rate changes within one .abx file, and"
echo "if so a warning will be printed"
echo "Press ENTER when ready."
read
for FILE in *.abx; do
for FILE in `find . -type f -name "*.[aA][bB][xX]"`; do
echo "File $FILE"
# This is lame and does not handle "Abx", but I
# do not want to mess with it too much
BASE="${FILE%%.abx}"
"$ABX2RAW" "$FILE" "${BASE}.raw"
"$SOX" -c 1 -r 11025 -b -s "${BASE}.raw" "${BASE}.wav"
BASE="${BASE%%.ABX}"
"$ABX2WAV" "$FILE" "${BASE}.wav"
echo
done