shellspeech-recognitionubuntu-18.04kaldi

How to resolve this Kaldi ASR MFCC feature Extraction


I am facing some issue related to Kaldi Feature extraction. I am new to Kaldi, please help me out.

OS: Ubuntu 18.04 I am currently trying to extract MFCC features and get VAD from the speech,when I am running the file 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

and I am getting this error

./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

Even I have provided the kaldi path correctly, it is showing me this error I will provide more details if required. Please help me out to resolve this.

Thanks


Solution

  • It seems you have not installed Kaldi. Kaldi binaries need to be compiled to make them executable. You can do the installation following the instructions in the INSTALL file in the root of the repo.

    Once you have installed it, you need to add it to your PATH variable. This can be done following any of the path.sh scripts in any example recipe. Once you have added it to your PATH, you can try to run compute-mfcc-feats from your command line and it should print a usage message.