#!/bin/sh
# example script to call sphinx2-batch to do forced alignment

# the binary to run
S2BATCH=sphinx2-batch

# the HMM directory 
HMM=/usr/share/sphinx2/model/hmm/6k

# the 'task'; the turtle demo by default.
TASK=/usr/share/sphinx2/model/lm/turtle

# the control file, which lists the utterance names, one per line
CTLFILE=/usr/share/sphinx2/model/lm/turtle/turtle.ctl

# the transcripts, one per line, to be used for the alignment
TACTLFN=/usr/share/sphinx2/model/lm/turtle/turtle.cor

# the dictionary
DICT=/usr/share/sphinx2/model/lm/turtle/turtle.dic

echo " "
echo "sphinx2-align:"
echo "   Use CMU Sphinx2 to perform phonetic alignment of an audio file"
echo "   to a known text transcription.  Shows an example."
echo " "

$S2BATCH -adcin TRUE -adcext 16k -ctlfn ${CTLFILE} -tactlfn ${TACTLFN} -ctloffset 0 -ctlcount 100000000 -datadir ${TASK} -agcmax TRUE -langwt 6.5 -fwdflatlw 8.5 -rescorelw 9.5 -ugwt 0.5 -fillpen 1e-10 -silpen 0.005 -inspen 0.65 -top 1 -topsenfrm 3 -topsenthresh -70000 -beam 2e-06 -npbeam 2e-06 -lpbeam 2e-05 -lponlybeam 0.0005 -nwbeam 0.0005 -fwdflat FALSE -fwdflatbeam 1e-08 -fwdflatnwbeam 0.0003 -bestpath TRUE -kbdumpdir ${TASK} -dictfn ${DICT} -ndictfn ${HMM}/noisedict -phnfn ${HMM}/phone -mapfn ${HMM}/map -hmmdir ${HMM} -hmmdirlist ${HMM} -8bsen TRUE -sendumpfn ${HMM}/sendump -cbdir ${HMM}

