annotate trunk/experiments/scripts/cnbh-syllables/feature_generation/convert_flac_to_wav.sh @ 335:71c438f9daf7

- Scripts for running recognition experiments using AIM-C and HTK to compare MFCCs against features generated with AIM-C
author tomwalters
date Wed, 04 Aug 2010 06:41:56 +0000
parents
children 4ca26619a4b6
rev   line source
tomwalters@335 1 #!/bin/bash
tomwalters@335 2 # Copyright 2009-2010 Thomas Walters <tom@acousticscale.org>
tomwalters@335 3 #
tomwalters@335 4 # Makes a copy of the cnbh syllables database in FLAC format found in
tomwalters@335 5 # $SOUNDS_ROOT/cnbh-syllables. The database is uncompressed to .WAV format
tomwalters@335 6 # for use with AIMCopy and HCopy.
tomwalters@335 7 # The first command-line argument is the location of $SOUNDS_ROOT
tomwalters@335 8 set -e
tomwalters@335 9 set -u
tomwalters@335 10
tomwalters@335 11 $SOUNDS_ROOT=$1
tomwalters@335 12
tomwalters@335 13 if [ ! -e $SOUNDS_ROOT/clean/.make_clean_wavs_success ] then
tomwalters@335 14 mkdir -p $SOUNDS_ROOT/clean
tomwalters@335 15 VOWELS="a e i o u"
tomwalters@335 16 CONSONANTS="b d f g h k l m n p r s t v w x y z"
tomwalters@335 17 for v in $VOWELS; do
tomwalters@335 18 mkdir $SOUNDS_ROOT/clean/$v$v
tomwalters@335 19 for c in $CONSONANTS; do
tomwalters@335 20 mkdir $SOUNDS_ROOT/clean/$c$v
tomwalters@335 21 mkdir $SOUNDS_ROOT/clean/$v$c
tomwalters@335 22 done
tomwalters@335 23 done
tomwalters@335 24 CURRENT_DIR=`pwd`
tomwalters@335 25 cd $SOUNDS_ROOT/cnbh-syllables/
tomwalters@335 26 for file in `find . -iname "*.flac"`; do
tomwalters@335 27 sox $file ../clean/${file%flac}.wav
tomwalters@335 28 done
tomwalters@335 29 touch $SOUNDS_ROOT/clean/.make_clean_wavs_success
tomwalters@335 30 cd $CURRENT_DIR
tomwalters@335 31 done