#!/bin/bash
#
# Copyright 2017 Johns Hopkins University (Author: Shinji Watanabe, Yenda Trmal)
# Apache 2.0
# Begin configuration section.
mictype=worn # worn, ref or others
cleanup=true
# End configuration section
. ./utils/parse_options.sh # accept options.. you can run this run.sh with the
. ./path.sh
echo >&2 "$0" "$@"
if [ $# -ne 3 ] ; then ##核对输入参数的数量是否准确
echo >&2 "$0" "$@"
echo >&2 "$0: Error: wrong number of arguments"
echo -e >&2 "Usage:\n $0 [opts] <audio-dir> <json-transcript-dir> <output-dir>"
echo -e >&2 "eg:\n $0 /corpora/chime5/audio/train /corpora/chime5/transcriptions/train data/train"
exit 1
fi
## set -e表示一旦脚本中有命令的返回值为非0,则脚本立即退出,后续命令不再执行;
## set -o pipefail表示在管道连接的命令序列中,只要有任何一个命令返回非0值,则整个管道返回非0值,即使最后一个命令返回0.
set -e -o pipefail
##adir是语音目录,jdir是标注文件所在目录,dir是输出目录
adir=$1
jdir=$2
dir=$3
json_count=$(find -L $jdir -name "*.json" | wc -l) ##此处是标注数据的数量统计
wav_count=$(find -L $adir -name "*.wav" | wc -l) ##此处是语音数据的数量统计
if [ "$json_count" -eq 0 ]; then
echo >&2 "We expect that the directory $jdir will contain json file
kaldi的prepare_data.sh模块解读
最新推荐文章于 2024-10-11 08:06:19 发布