annotate experiments/scripts/cnbh-syllables/feature_generation/convert_flac_to_wav.sh @ 607:49eef19e4f1d

Added JSON output for use with node.js and backbone.js
author sness@sness.net
date Fri, 10 May 2013 20:12:49 +0000
parents effb9f6052f1
children
rev   line source
tomwalters@54 1 #!/bin/bash
tomwalters@54 2 # Copyright 2009-2010 Thomas Walters <tom@acousticscale.org>
tomwalters@54 3 #
tomwalters@54 4 # Makes a copy of the cnbh syllables database in FLAC format found in
tomwalters@54 5 # $SOUNDS_ROOT/cnbh-syllables. The database is uncompressed to .WAV format
tomwalters@54 6 # for use with AIMCopy and HCopy.
tomwalters@54 7 # The first command-line argument is the location of $SOUNDS_ROOT
tomwalters@54 8 set -e
tomwalters@54 9 set -u
tomwalters@54 10
tomwalters@172 11 SOUNDS_ROOT=$1
tomwalters@54 12
tomwalters@174 13 if [ ! -e $SOUNDS_ROOT/clean/.make_clean_wavs_success ]; then
tomwalters@54 14 mkdir -p $SOUNDS_ROOT/clean
tomwalters@54 15 VOWELS="a e i o u"
tomwalters@54 16 CONSONANTS="b d f g h k l m n p r s t v w x y z"
tomwalters@54 17 for v in $VOWELS; do
tomwalters@175 18 mkdir -p $SOUNDS_ROOT/clean/$v$v
tomwalters@54 19 for c in $CONSONANTS; do
tomwalters@175 20 mkdir -p $SOUNDS_ROOT/clean/$c$v
tomwalters@175 21 mkdir -p $SOUNDS_ROOT/clean/$v$c
tomwalters@54 22 done
tomwalters@54 23 done
tomwalters@54 24 CURRENT_DIR=`pwd`
tomwalters@54 25 cd $SOUNDS_ROOT/cnbh-syllables/
tomwalters@54 26 for file in `find . -iname "*.flac"`; do
tomwalters@176 27 sox $file ../clean/${file%flac}wav
tomwalters@54 28 done
tomwalters@54 29 touch $SOUNDS_ROOT/clean/.make_clean_wavs_success
tomwalters@54 30 cd $CURRENT_DIR
tomwalters@174 31 fi