CMUSphinx 搭建语音识别引擎(一)安装配置

关于CMUSphinx的这两篇文章,我早在18年就写好了保存在草稿箱,当时想做好一个系列多沉淀下再发,可惜后面工作计划有变,没能在项目中继续学习,私下也没在研究。今天整理博客后决定发出来吧,说不定有人正好需要。

一、下载地址

https://cmusphinx.github.io/wiki/download/

二、下载内容

Pocketsphinx — 用C语言编写的轻量级识别库

Sphinxbase — Pocketsphinx所需要的支持库

Sphinx4 — 为语音识别研究用C语言编写的解码器

Sphinxtrain — 声学模型训练工具

 

以上对应官网最新版本:

We recommend you to use the latest available releases:

下载后的压缩包为以下:

  1. sphinxbase-5prealpha.tar

  2. pocketsphinx-5prealpha.tar

  3. sphinxtrain-5prealpha.tar
  4. sphinx4-5prealpha-src

将上述压缩包复制到linux中,或者直接从linux中下载

 

 

至此,下载工作完成!

三、编译环境

Linux操作系统

四、安装配置

1.安装Sphinxbase

  • tar xzf sphinxbase-5prealpha.tar.gz
  • cd sphinxbase-5prealpha
  • ./configure
  • make
  • make install

此步骤可能出现的错误:

1.checking for bison... no ;configure: error: You need to install bison

解决:sudo apt-get install bison

2.configure: error:
  Could not link test program to Python. Maybe the main Python library has been
  installed in some non-standard library path. If so, pass it to configure,
  via the LDFLAGS environment variable.
  Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"
  ============================================================================
   ERROR!
   You probably have to install the development version of the Python package
   for your distribution.  The exact name of this package varies among them.
  ============================================================================

解决:sudo apt-get install python-dev

 

3.checking for swig2.0... no;configure: error: swig not found

解决: sudo apt-get install swig

 

最后再执行 ./configure,如果没有其他错误,则会出现大概下面的样子:

 

 

然后 make -- sudo make install,这两步执行完没有error就是成功了。

最后再usr/local/bin 下面,会看到安装目录

 

2.安装pocketsphinx

./configure
make clean all
make check
sudo make install

没有error就是成功了,之后再打开usr/local/bin 会看到新生成了几个文件

就是下面三个:

pocketsphinx_batch

pocketsphinx_continuous

pocketsphinx_mdef_convert

 

3.设置环境变量

export  LD_LIBRARY_PATH=/usr/local/lib  //存放着动态库

export  PKG_CONFIG_PATH=/usr/local/lib/pkgconfig // 不知道

 

4.验证是否成功

在任意目录下输入下面的命令检测是否配置

 pocketsphinx_continuous

如果出现下图,则说明配置成功:

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Code王工

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值