Sphinx语音识别学习记录 (五)错误调试

CMUSphinx系列目录

如何解决使用别的声学模型的时候出现的问题

使用别人训练好的hmm模型的时候一直报以下错误(我这里使用的Communicator_40.cd_cont_4000这个模型)

INFO: acmod.c(242): Parsed model-specific feature parameters from Communicator_4
0.cd_cont_4000/feat.params
ERROR: "fe_interface.c", line 101: FFT: Number of points must be greater or equa
l to frame size (409 samples)

这时候就进入该模型的参数配置文件feat.params中修改参数

-nfft 256 把这条参数改成 -nfft 512 或者直接删除掉这条就可以用了

不过这参数的用处还没搞明白

ad_oss.c(103): Failed to open audio device(/dev/dsp): No such file or directory
FATAL_ERROR: "continuous.c", line 242: Failed top open audio device

网上别人说是

(1) Soundrecorder 测试下能否使用

(2) sudo apt-get install libasound2-dev

recompiled sphinxbase

还是没有任何效果

Can't open audio device /dev/dsp: No such file or directory

解决办法是加载snd_pcm_oss,即以root身份执行modprobe snd_pcm_oss。

结果执行这句之后提示没有snd_pcm_oss...网上找了半天发现貌似要装alsa-driver

http://www.alsa-project.org/main/index.php/Main_Page

装上去了,又然后再执行,再提示我

WARNING: Error inserting snd_page_alloc (/lib/modules/3.2.0-26-generic-pae/kernel/sound/acore/snd-page-alloc.ko): Operation not permitted
WARNING: Error inserting snd_timer (/lib/modules/3.2.0-26-generic-pae/kernel/sound/acore/snd-timer.ko): Operation not permitted
WARNING: Error inserting snd_pcm (/lib/modules/3.2.0-26-generic-pae/kernel/sound/acore/snd-pcm.ko): Operation not permitted
FATAL: Error inserting snd_pcm_oss (/lib/modules/3.2.0-26-generic-pae/kernel/sound/acore/oss/snd-pcm-oss.ko): Operation not permitted

我去啊。。。OTZ,然后发现我少装了alsa-util

各种依赖包。。。第一次用linux,完全不懂怎么找依赖包啊

幸好还有人写了怎么装alsa-util。。。 

http://www.linuxeden.com/html/hardware/20091220/69686.html

http://ceeji.net/blog/fix-ubuntu-sound/zh-hans/

麦克风不能用的解决方法

Open terminal and paste "sudo gedit /etc/modprobe.d/alsa-base.conf", hit Enter. It will open a file alsa-base.conf. scroll to the end of the file and add the this "options snd-hda-intel position_fix=1" as a new line, save the file and reboot. Enjoy this!

// 找到一个办法,添加 "options snd-hda-intel position_fix=1 enable=yes" 到文件
// /etc/modprobe.d/alsa-base.conf 中(sudo gedit /etc/modprobe.d/alsa-base.conf) 

 然后还有一点,千万要确认你的麦克风是好的。。。搞了一下午,始终没法让麦发出声音,然后进了windows测麦克风发现,麦克风不能识别。。。thinkpad的耳麦,用专用的扩展孔也不好用啊。。。坑爹

然后我的dic文件是靠http://www.speech.cs.cmu.edu/tools/lmtool.html这个网站在线做出来的

然后发现有些单词的发音会很奇怪。。。可能有些还需要自己稍微修改下

lm语言模型还没搞清楚他的意义。。。也是上面的地址、在线做出来的、不过里面的gram也不知道做什么的

grammar吗?

文章出处:http://www.cnblogs.com/yin52133/ 本文可自行转载,但转载时记得给出原文链接
原文地址:https://www.cnblogs.com/yin52133/p/2558806.html