‹ projects

vmc

a voice model creator for CMU Sphinx
Log | Files | Refs | README | LICENSE

commit 91a16b298eb6386ca2b7cf045aebc5a9712075df
parent 8144f5556e295af619497f7cf1523bb810431fed
Author: umhau <umhau@alum.gcc.edu>
Date:   Sun, 11 Jun 2017 21:23:46 -0400

cleaned up formatting - 100 column width to 80.

Diffstat:
Minstallvmc.sh | 37+++++++++++++------------------------
Mlmt.sh | 25++++++++-----------------
Muninstallvmc.sh | 6++----
Mvmc.sh | 18++++--------------
4 files changed, 27 insertions(+), 59 deletions(-)

diff --git a/installvmc.sh b/installvmc.sh @@ -6,47 +6,36 @@ # # NOTES # -# Copies the vmc packages into /opt/vmc, and puts the vmc script into /usr/local/bin. Once -# there, vmc can be called (with its requisite options) from anywhere with just vmc.sh. +# Copies the vmc packages into /opt/vmc, and puts the vmc script into +# /usr/local/bin. Once there, vmc can be called (with its requisite +# options) from anywhere with just vmc.sh. # -# SET VARIABLES =================================================================================== +# SET VARIABLES =============================================================== - -script=$(readlink -f "$0") # Absolute path to this script, e.g. /home/user/bin/foo.sh -scriptpath=$(dirname "$script") # Absolute path this script is in, thus /home/user/bin - # http://stackoverflow.com/questions/242538/unix-shell-script-find-out-which-directory-the-script-file-resides +# Absolute path to this script & containing folder. stackoverflow.com/q/242538 +script=$(readlink -f "$0"); scriptpath=$(dirname "$script") -tdir=/opt/vmc/tools +tdir=/opt/vmc/tools; fdir=/opt/vmc/functions -fdir=/opt/vmc/functions - -# CHECK FOR PREVIOUS INSTALLATION ================================================================= +# CHECK FOR PREVIOUS INSTALLATION ============================================= if [ -d /opt/vmc/ ]; then - echo -n "Removing vmc..." - - bash $scriptpath/uninstallvmc.sh 1>/dev/null + bash $scriptpath/uninstallvmc.sh 1>/dev/null; echo -n "Removed vmc"; - echo "done." - - # echo "A version of vmc is already installed. To uninstall, run uninstallvmc.sh" - # exit 1 + # echo "vmc is already installed. To remove, run uninstallvmc.sh"; exit 1 fi -# MOVE VMC FILES ================================================================================== +# MOVE VMC FILES ============================================================== # get sudo -sudo ls 1>/dev/null - -echo -n "Installing vmc..." +sudo ls 1>/dev/null; echo -n "Installing vmc..." # create vmc directories -sudo mkdir -p $tdir -sudo mkdir -p $fdir +sudo mkdir -p $tdir; sudo mkdir -p $fdir # move tools sudo cp -r $scriptpath/tools/* $tdir/ diff --git a/lmt.sh b/lmt.sh @@ -4,16 +4,15 @@ # # Given a list of sentences, create a statistical language model. # -# USAGE -# -# lmt.sh lm-training-file lm-file-name output-location +# USAGE: lmt.sh lm-training-file lm-file-name output-location # -# DEPENDENCIES -# -# CMU Sphinx, Perl, and other misc. packages. -# +# VARIABLES =================================================================== + +sentence_list_file=$1; output_lm_file_name=$2; save_directory=$3; + +fdir=/opt/vmc/functions -# VARIABLES ======================================================================================= +# CHECK IF HELP NEEDED ======================================================== if [[ -z $1 ]]; then @@ -29,15 +28,7 @@ if [[ -z $1 ]]; then fi -sentence_list_file=$1 - -output_lm_file_name=$2 - -save_directory=$3 - -fdir=/opt/vmc/functions - -# COMMANDS ======================================================================================== +# COMMANDS ==================================================================== # build language model bash $fdir/buildLM.sh $sentence_list_file $output_lm_file_name $save_directory diff --git a/uninstallvmc.sh b/uninstallvmc.sh @@ -1,11 +1,9 @@ #!/bin/bash # -# USAGE -# -# bash uninstallvmc.sh +# USAGE: bash uninstallvmc.sh # -# DELETE EVERYTHING =============================================================================== +# DELETE EVERYTHING =========================================================== sudo rm -rf /opt/vmc diff --git a/vmc.sh b/vmc.sh @@ -55,21 +55,13 @@ export LD_LIBRARY_PATH=/usr/local/lib if [[ $2 = '-record' ]]; then - vm_training_file=$3 - output_folder=$4 + vm_training_file=$3; output_folder=$4 - if [[ -n $5 ]]; then - iterations=$5 - else - iterations=1 - fi + if [[ -n $5 ]]; then iterations=$5; else iterations=1; fi elif [[ $2 = '-import' ]]; then - audio_file_directory=$3 - sentence_file=$4 - output_folder=$5 - iterations=1 + audio_file_directory=$3; sentence_file=$4; output_folder=$5; iterations=1 else @@ -91,9 +83,7 @@ model_name=$1 audio_folder=$output_folder/audio -tdir=/opt/vmc/tools - -fdir=/opt/vmc/functions +tdir=/opt/vmc/tools; fdir=/opt/vmc/functions # COMMANDS ====================================================================