#!/bin/bash
. ./cmd.sh ## You'll want to change cmd.sh to something that will work on your system.
## This relates to the queue.
. ./path.sh
#在运行run.sh之前首先要运行cmd.sh和path.sh
H=`pwd` #exp home
n=8 #parallel jobs 并行任务数量,根据cpu的个数来决定
#corpus and trans directory 数据集存放的位置
thchs=/nfs/public/materials/data/thchs30-openslr
#you can obtain the database by uncommting the following lines #||逻辑或 先执行左边
#[ -d $thchs ] || mkdir -p $thchs || exit 1
#echo "downloading THCHS30 at $thchs ..."
#local/download_and_untar.sh $thchs http://www.openslr.org/resources/18 data_thchs30 || exit 1
#local/download_and_untar.sh $thchs http://www.openslr.org/resources/18 resource || exit 1
#local/download_and_untar.sh $thchs http://www.openslr.org/resources/18 test-noise || exit 1
#data preparation 进行数据准备工作
#generate text, wav.scp, utt2pk, spk2utt 生成这些文件
local/thchs-30_data_prep.sh $H $thchs/data_thchs30 || exit 1;
#produce MFCC features 生成MFCC特征
#删除data目录下的mfcc, 并创建mfcc,将大括号里的数据拷贝到mfcc目录
rm -rf data/mfcc && mkdir -p data/mfcc && cp -R data/{train,dev,test,test_phone} data/mfcc || exit 1;
for x in train dev test; do
#make mfcc 生成mfcc
steps/make_mfcc.sh --nj $n --cmd "$train_cmd" data/mfcc/$x exp/make_mfcc/$x mfcc/$x || exit 1;
# 调用steps/make_mfcc.s