kaldi timit 语音库在线解码应用

该博客介绍了如何在Kaldi中安装Portaudio,编译onlinebin,并创建脚本测试TIMIT语音库的在线解码过程。通过修改配置、编译和运行特定脚本,进行实时解码实验,解决可能出现的权限问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

具体解码文件结果在这


评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值