#!/bin/sh
# ====================================================================
# Copyright (c) 2000 Carnegie Mellon University.  All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer. 
#
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in
#    the documentation and/or other materials provided with the
#    distribution.
#
# This work was supported in part by funding from the Defense Advanced 
# Research Projects Agency and the National Science Foundation of the 
# United States of America, and the CMU Sphinx Speech Consortium.
#
# THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND 
# ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
# NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# ====================================================================

#if [ ! "$SPHINXTRAINDIR" ]
#then
#   echo "environment variable SPHINXTRAINDIR is unset"
#   echo "set it to your local SphinxTrain directory e.g."
#   echo '   bash$ export SPHINXTRAINDIR=/home/awb/projects/SphinxTrain/'
#   echo or
#   echo '   csh% setenv SPHINXTRAINDIR /home/awb/projects/SphinxTrain/'
#   exit 1
#fi

if [ $# != 1 ]
then
    echo "Make (MFC) Feature files "
    echo "Usage: bin/make_feats etc/DBNAME.fileids"
    echo "DBNAME short name for this training set"
    exit 1
fi


# Must be compatible to existing acoustic models
# WIDEBAND (NARROWBAND) = -alpha  0.97
#          -srate  16000 (8000)
#          -frate  100
#          -wlen   0.0256
#          -nfft   512
#          -nfilt  40 (31)
#          -lowerf 130
#          -upperf 6800 (3500)
#          -ncep   13

# This script defaults to processing files in a control file with
# default data format being NIST's Sphere. Change "-nist" to "-raw"
# for raw headerless audio data. Run the command without arguments to
# find if the machine endian setting is correct.

bin/wave2feat -verbose -c $1 -nist -di wav -ei wav -do feat -eo feat 
