<span style="font-size:18px;">
</span>
目录:
1.安装portaudio
2.编译onlinebin
3.创建脚本测试
1.安装Portaudio:
$cd ~/kaldi-trunk/tools/
$./install_portaudio.sh 这里需要修改一处配置,不然后面可能会出现这些错误
<span style="font-size:18px;">kaldi portaudio/src/hostapi/jack/pa_jack.c:1734: undefined reference to `jack_get_sample_rate</span>
2.编译onlinebin
$cd ~/kaldi-trunk/src/onlinebin/
$make
3.创建脚本测试:
$cd ~/kaldi-trunk/egs/timit/s5/exp/tri1/
$vim test_online_decode.sh
添加如下一段:
/kaldi-trunk/src/onlinebin/online-wav-gmm-decode-faster --rt-min=0.3 --rt-max=0.5 --max-active=4000 --beam=12.0 --acoustic-scale=0.0769 scp:../../data/train/split10/1/wav.scp final.mdl graph/HCLG.fst graph/words.txt '1:2:3:4:5' ark,t:trans.txt ark,t:ali.txt
$sudo ./test_online_decode.sh 运行
如果出现错误可能是由于权限不足导致,如下的错误提示:
<span style="font-size:18px;">/home/xiantao/kaldi-trunk/src/onlinebin/online-wav-gmm-decode-faster --rt-min=0.3 --rt-max=0.5 --max-active=4000 --beam=12.0 --acoustic-scale=0.0769 scp:../../data/train/split10/1/wav.scp final.mdl graph/HCLG.fst graph/words.txt 1:2:3:4:5 ark,t:trans.txt ark,t:ali.txt
ERROR (online-wav-gmm-decode-faster:TableWriter():util/kaldi-table-inl.h:1138) TableWriter: failed to write to ark,t:trans.txt
ERROR (online-wav-gmm-decode-faster:TableWriter():util/kaldi-table-inl.h:1138) TableWriter: failed to write to ark,t:trans.txt
[stack trace: ]
kaldi::KaldiGetStackTrace()
kaldi::KaldiErrorMessage::~KaldiErrorMessage()
kaldi::TableWriter<kaldi::BasicVectorHolder<int> >::TableWriter(std::string const&)
/home/xiantao/kaldi-trunk/src/onlinebin/online-wav-gmm-decode-faster(main+0x783) [0x5d2730]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f0f7a56eec5]
/home/xiantao/kaldi-trunk/src/onlinebin/online-wav-gmm-decode-faster() [0x5d1ee2]</span>
解码日志结果:(只有部分)
<span style="font-size:18px;">/home/xiantao/kaldi-trunk/src/onlinebin/online-wav-gmm-decode-faster --rt-min=0.3 --rt-max=0.5 --max-active=4000 --beam=12.0 --acoustic-scale=0.0769 scp:../../data/train/split10/1/wav.scp final.mdl graph/HCLG.fst graph/words.txt 1:2:3:4:5 ark,t:trans.txt ark,t:ali.txt
File: faem0_si1392
sil ax s iy m f ao r ix vcl z ae m cl p uh l ax s ix cl ch uw ey sh en w er f aa r m hh eh z ax cl p ae cl k ix ng sh eh vcl d sil ae n vcl d f iy l vcl s sil
File: faem0_si2022
sil
sil
sil w ah dx aw f ih cl t ih sh iy vcl d r ay f ao r sil
File: faem0_si762
sil f ih l s epi m ao l hh ow l ix n vcl b ow l ix th cl k l ey sil
File: faem0_sx132
sil p ow vcl b l ih s ix dx iy eh n ow dx er r ay ix dx iy vcl g ow hh ae n vcl d ix n hh ae n cl s sil
File: faem0_sx222
sil y uw ao l ih s cl k aa m cl w ix th cl p ae th ax l aa vcl jh ix cl k el ix vcl g z ae m cl p el s sil
File: faem0_sx312
sil dh ow z ae n cl t er z w ax vcl b iy s cl t r ey cl f ao w er dx ix f y uw th iy ng cl k dh ix n th r uw cl k eh r f el iy f er s cl t sil
File: faem0_sx402
sil
sil
sil w ih l s er v r uw vcl b aa r vcl p ay ae cl t er r ey cl ch el s cl t ao cl k sil
File: faem0_sx42
sil b ih vcl d uh cl k el s cl k aa l er z aa r vcl jh y uw hh ih s cl t r iy sil
File: fajw0_si1263
sil
sil
sil b ah hh ae v eh cl k s el eh n ix n ix vcl g r ey sh ix n ax dh ih f ih s cl k el cl p ae cl k s cl k l eh cl sh ix n y er cl k ae l ix n vcl d ix n z sil
File: fajw0_si1893
sil ix cl t ix cl k ih m ax l ao ng cl t ay m cl t ax cl k m cl p ow z m s ow sil
File: fajw0_si633
sil hh iy l ay cl t ix n ih cl p ih r l ow vcl b z ax v ah n s ix s cl p eh cl t ix ng vcl d ix z ix vcl d er z w ix cl t ix z n iy vcl d el sh aa cl t iy sil
File: fajw0_sx183
sil
sil w ay eh l s w uh vcl d ae n iy ax l aw ah dh ix z cl t ix vcl g ow sil
</span>
具体解码文件结果在这