0

我面临一些与 Kaldi 特征提取相关的问题。我是 Kaldi 的新手,请帮帮我。

操作系统:Ubuntu 18.04 我目前正在尝试提取 MFCC 功能并从语音中获取 VAD,当我运行文件 mfcc.sh 时

 #!/bin/bash
#cd ./allWavFiles/
kaldi_path=~/kaldi
featbin_path=$kaldi_path/src/featbin
ivectorbin_path=$kaldi_path/src/ivectorbin
folder=~/Downloads/

find ./ -iname "*.wav" > files
sed -e 's/.wav//g;s/Audio//g;s/\///g;s/\.//g' files > unique
paste unique files | sed 's/\t/ /g' > wav.scp
mkdir mfcc;
mkdir vad;
count=`ls Audio | wc -l`

for i in `seq 1 $count`;
do 
cat wav.scp | head -n $i | tail -1 > wav_1.scp
    name=`cat wav_1.scp | cut -d " "  -f1`
    name=$name'.txt';
#Computing mfccs and copying to archive
$featbin_path/compute-mfcc-feats --frame-length=20 scp,p:wav_1.scp ark:- | $featbin_path/copy-feats --compress=true ark:- ark,scp:test.ark,feats.scp
$featbin_path/add-deltas ark:test.ark ark,scp:test_delta.ark,feats_delta.scp
$ivectorbin_path/compute-vad scp:feats_delta.scp ark,t:vad/$name 
$featbin_path/compute-cmvn-stats scp:feats_delta.scp ark,scp:cmvn.ark,cmvn.scp
$featbin_path/apply-cmvn scp:cmvn.scp scp:feats_delta.scp ark,t:mfcc/$name
sed -i '1d' mfcc/$name
sed -i "s/\]//g" mfcc/$name
sed -i 's/.*\[\([^]]*\)\].*/\1/g' vad/$name
done

rm -r files unique wav.scp wav_1.scp feats.scp test.ark test_delta.ark feats_delta.scp cmvn.scp cmvn.ark

#Readable archive
#$path/copy-feats ark:test.ark ark,t:mytext.arkco

我收到了这个错误

./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/compute-mfcc-feats: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/copy-feats: No such file or directory
./mfcc.sh: line 22: /home/navaneeth/kaldi/src/featbin/add-deltas: No such file or directory
./mfcc.sh: line 23: /home/navaneeth/kaldi/src/ivectorbin/compute-vad: No such file or directory
./mfcc.sh: line 24: /home/navaneeth/kaldi/src/featbin/compute-cmvn-stats: No such file or directory
./mfcc.sh: line 25: /home/navaneeth/kaldi/src/featbin/apply-cmvn: No such file or directory
sed: can't read mfcc/5.txt: No such file or directory
sed: can't read mfcc/5.txt: No such file or directory
sed: can't read vad/5.txt: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/compute-mfcc-feats: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/copy-feats: No such file or  directory
./mfcc.sh: line 22: /home/navaneeth/kaldi/src/featbin/add-deltas: No such file or directory
./mfcc.sh: line 23: /home/navaneeth/kaldi/src/ivectorbin/compute-vad: No such file or directory
./mfcc.sh: line 24: /home/navaneeth/kaldi/src/featbin/compute-cmvn-stats: No such file or directory
./mfcc.sh: line 25: /home/navaneeth/kaldi/src/featbin/apply-cmvn: No such file or directory
sed: can't read mfcc/4.txt: No such file or directory
sed: can't read mfcc/4.txt: No such file or directory
sed: can't read vad/4.txt: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/copy-feats: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/compute-mfcc-feats: No such file or directory
./mfcc.sh: line 22: /home/navaneeth/kaldi/src/featbin/add-deltas: No such file or directory
./mfcc.sh: line 23: /home/navaneeth/kaldi/src/ivectorbin/compute-vad: No such file or directory
./mfcc.sh: line 24: /home/navaneeth/kaldi/src/featbin/compute-cmvn-stats: No such file or directory
./mfcc.sh: line 25: /home/navaneeth/kaldi/src/featbin/apply-cmvn: No such file or directory
sed: can't read mfcc/2.txt: No such file or directory
sed: can't read mfcc/2.txt: No such file or directory
sed: can't read vad/2.txt: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/compute-mfcc-feats: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/copy-feats: No such file or directory
./mfcc.sh: line 22: /home/navaneeth/kaldi/src/featbin/add-deltas: No such file or directory
./mfcc.sh: line 23: /home/navaneeth/kaldi/src/ivectorbin/compute-vad: No such file or directory
./mfcc.sh: line 24: /home/navaneeth/kaldi/src/featbin/compute-cmvn-stats: No such file or directory
./mfcc.sh: line 25: /home/navaneeth/kaldi/src/featbin/apply-cmvn: No such file or directory
sed: can't read mfcc/1.txt: No such file or directory
sed: can't read mfcc/1.txt: No such file or directory
sed: can't read vad/1.txt: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/compute-mfcc-feats: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/copy-feats: No such file or directory
./mfcc.sh: line 22: /home/navaneeth/kaldi/src/featbin/add-deltas: No such file or directory
./mfcc.sh: line 23: /home/navaneeth/kaldi/src/ivectorbin/compute-vad: No such file or directory
./mfcc.sh: line 24: /home/navaneeth/kaldi/src/featbin/compute-cmvn-stats: No such file or directory
./mfcc.sh: line 25: /home/navaneeth/kaldi/src/featbin/apply-cmvn: No such file or directory
sed: can't read mfcc/3.txt: No such file or directory
sed: can't read mfcc/3.txt: No such file or directory
sed: can't read vad/3.txt: No such file or directory
rm: cannot remove 'feats.scp': No such file or directory
rm: cannot remove 'test.ark': No such file or directory
rm: cannot remove 'test_delta.ark': No such file or directory
rm: cannot remove 'feats_delta.scp': No such file or directory
rm: cannot remove 'cmvn.scp': No such file or directory
rm: cannot remove 'cmvn.ark': No such file or directory

即使我正确提供了 kaldi 路径,它也会向我显示此错误,如果需要,我会提供更多详细信息。请帮我解决这个问题。

谢谢

4

1 回答 1

0

看来你还没有安装 Kaldi。Kaldi 二进制文件需要编译以使其可执行。您可以按照repo 根目录中的INSTALL文件中的说明进行安装。

安装后,您需要将其添加到 PATH 变量中。这可以在任何示例配方中的任何 path.sh 脚本之后完成。将其添加到 PATH 后,您可以尝试从命令行运行compute-mfcc-feats,它应该会打印一条使用消息。

于 2021-06-17T14:10:28.633 回答