环境:Ubuntu 12.04, Kaldi
timit训练完语音模型后可以进入解码,
1. 首先安装PortAudio
cd /u01/kaldi/tools/portaudio
./configure
make
sudo make install
2. 编译安装onlinebin
cd /u01/kaldi/src/onlinebin
make
离线解码:
3. 切换到训练好的模型目录/u01/kaldi/egs/timit/s5/exp/tri1,执行命令如下:
/u01/kaldi/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 uw m f ao r ix vcl z ae m cl p el 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 ae n vcl d f iy l vcl s sil
File: faem0_si2022
sil
sil
sil w ah dx ow cl t 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 w ix cl k l ey sil
sil m ey ay vcl d ow ix n vcl g eh cl k ix s ae n vcl jh ix m aa m ah sil
File: fhxs0_sx175
sil s ix v iy ah m ay eh l cl p iy ah cl k ix n cl t ey vcl b iy dx ih cl t uw r aa n z epi f iy r iy aa r dx iy cl k aa m c
File: fhxs0_sx265
sil dh ix s ao r ih z vcl b r ow cl k ix n s ah cl ch aa cl p dh ax w uh vcl en s cl t eh vcl sil
File: fhxs0_sx355
sil
sil aa l f ih n z aa r ix n cl t eh l ix vcl jh ix n er r iy n m ae m ax l s sil
File: fhxs0_sx445
sil w ah dx ih z ih z l ao vcl jh ix ng vcl b ay dx iy ay n iy ng vcl b el ix cl sil
File: fhxs0_sx85
sil s ix m eh n cl t ix z epi m eh zh uw dx ix n cl k y uw vcl b ih cl k y aa r vcl d z sil
4. 在线解码 (需要microphone)
jerry@hq:/u01/kaldi/egs/timit/s5/exp/tri1$ /u01/kaldi/src/onlinebin/online-gmm-decode-faster –rt-min=0.3 –rt-max=0.5 –max-active=4000 –beam=12.0 –acoustic-scale=0.0769 final.mdl graph/HCLG.fst graph/words.txt ‘1:2:3:4:5’
另外一个在线解码应用
cd /u01/kaldi/egs/voxforge/online_demo
./run.sh –test-mode live