语音识别基础篇(二) - pocketsphinx在windows下的编译和运行

2023-10-08 23:20

本文主要是介绍语音识别基础篇(二) - pocketsphinx在windows下的编译和运行,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

如需转载请标明出处:http://blog.csdn.net/itas109 

QQ技术交流群:129518033

相关文章

语音识别基础篇(一) - CMU Sphinx简介

http://blog.csdn.net/itas109/article/details/78568591

1.编译环境

操作系统:windows 7 64Bit SP1

编译器:Viual Studio 2013

pocketsphinx版本:5prealpha

编译版本:Debug

下载地址:

CMU Sphinx - Browse /sphinxbase/5prealpha at SourceForge.net

CMU Sphinx - Browse /pocketsphinx/5prealpha at SourceForge.net

下载完成解压后目录如下图

2.编译sphinxbase

pocketsphinx依赖于sphinxbase,因此需要先编译sphinxbase。

使用VS2013打开sphinxbase.sln,直接点击生成解决方案即可

输出结果

3.编译pocketsphinx

使用VS2013打开pocketsphinx.sln,直接点击生成解决方案,结果报错了。。。

看错误估计是路径不对,然后右键pocketsphinx查看属性

经过查看果然路径有问题,将sphinxbase-master文件夹修改为sphinxbase文件夹,继续编译就通过了。

至此,pocketsphinx的编译工作结束了

4.运行

将sphinxbase.dll复制到pocketsphinx运行目录下,不然会报缺少DLL的错误。

如果有麦克风可以运行一下命令:

pocketsphinx_continuous.exe -inmic yes -hmm model\en-us\en-us -lm model\en-us\en-us.lm.bin -dict model\en-us\cmudict-en-us.dict

也可以直接读取文件:

pocketsphinx_continuous.exe -infile test\data\goforward.raw -hmm model\en-us\en-us -lm model\en-us\en-us.lm.bin  -dict model\en-us\cmudict-en-us.dict

这里我们使用文件来运行:

pocketsphinx_continuous.exe -infile D
:\ASR\pocketsphinx-master\test\data\cards\004.wav -hmm D:\ASR\pocketsphinx-maste
r\model\en-us\en-us -lm D:\ASR\pocketsphinx-master\model\en-us\en-us.lm.bin -dic
t D:\ASR\pocketsphinx-master\model\en-us\cmudict-en-us.dict


运行结果如下:

D:\ASR\pocketsphinx-master\bin\Debug\Win32>pocketsphinx_continuous.exe -infile D
:\ASR\pocketsphinx-master\test\data\cards\004.wav -hmm D:\ASR\pocketsphinx-maste
r\model\en-us\en-us -lm D:\ASR\pocketsphinx-master\model\en-us\en-us.lm.bin -dic
t D:\ASR\pocketsphinx-master\model\en-us\cmudict-en-us.dict
INFO: pocketsphinx.c(152): Parsed model-specific feature parameters from D:\ASR\
pocketsphinx-master\model\en-us\en-us/feat.params
Current configuration:
[NAME]                  [DEFLT]         [VALUE]
-agc                    none            none
-agcthresh              2.0             2.000000e+000
-allphone
-allphone_ci            yes             yes
-alpha                  0.97            9.700000e-001
-ascale                 20.0            2.000000e+001
-aw                     1               1
-backtrace              no              no
-beam                   1e-48           1.000000e-048
-bestpath               yes             yes
-bestpathlw             9.5             9.500000e+000
-ceplen                 13              13
-cmn                    live            batch
-cmninit                40,3,-1         41.00,-5.29,-0.12,5.09,2.48,-4.07,-1.37,
-1.78,-5.08,-2.05,-6.45,-1.42,1.17
-compallsen             no              no
-dict                                   D:\ASR\pocketsphinx-master\model\en-us\c
mudict-en-us.dict
-dictcase               no              no
-dither                 no              no
-doublebw               no              no
-ds                     1               1
-fdict
-feat                   1s_c_d_dd       1s_c_d_dd
-featparams
-fillprob               1e-8            1.000000e-008
-frate                  100             100
-fsg
-fsgusealtpron          yes             yes
-fsgusefiller           yes             yes
-fwdflat                yes             yes
-fwdflatbeam            1e-64           1.000000e-064
-fwdflatefwid           4               4
-fwdflatlw              8.5             8.500000e+000
-fwdflatsfwin           25              25
-fwdflatwbeam           7e-29           7.000000e-029
-fwdtree                yes             yes
-hmm                                    D:\ASR\pocketsphinx-master\model\en-us\e
n-us
-input_endian           little          little
-jsgf
-keyphrase
-kws
-kws_delay              10              10
-kws_plp                1e-1            1.000000e-001
-kws_threshold          1e-30           1.000000e-030
-latsize                5000            5000
-lda
-ldadim                 0               0
-lifter                 0               22
-lm                                     D:\ASR\pocketsphinx-master\model\en-us\e
n-us.lm.bin
-lmctl
-lmname
-logbase                1.0001          1.000100e+000
-logfn
-logspec                no              no
-lowerf                 133.33334       1.300000e+002
-lpbeam                 1e-40           1.000000e-040
-lponlybeam             7e-29           7.000000e-029
-lw                     6.5             6.500000e+000
-maxhmmpf               30000           30000
-maxwpf                 -1              -1
-mdef
-mean
-mfclogdir
-min_endfr              0               0
-mixw
-mixwfloor              0.0000001       1.000000e-007
-mllr
-mmap                   yes             yes
-ncep                   13              13
-nfft                   512             512
-nfilt                  40              25
-nwpen                  1.0             1.000000e+000
-pbeam                  1e-48           1.000000e-048
-pip                    1.0             1.000000e+000
-pl_beam                1e-10           1.000000e-010
-pl_pbeam               1e-10           1.000000e-010
-pl_pip                 1.0             1.000000e+000
-pl_weight              3.0             3.000000e+000
-pl_window              5               5
-rawlogdir
-remove_dc              no              no
-remove_noise           yes             yes
-remove_silence         yes             yes
-round_filters          yes             yes
-samprate               16000           1.600000e+004
-seed                   -1              -1
-sendump
-senlogdir
-senmgau
-silprob                0.005           5.000000e-003
-smoothspec             no              no
-svspec                                 0-12/13-25/26-38
-tmat
-tmatfloor              0.0001          1.000000e-004
-topn                   4               4
-topn_beam              0               0
-toprule
-transform              legacy          dct
-unit_area              yes             yes
-upperf                 6855.4976       6.800000e+003
-uw                     1.0             1.000000e+000
-vad_postspeech         50              50
-vad_prespeech          20              20
-vad_startspeech        10              10
-vad_threshold          3.0             3.000000e+000
-var
-varfloor               0.0001          1.000000e-004
-varnorm                no              no
-verbose                no              no
-warp_params
-warp_type              inverse_linear  inverse_linear
-wbeam                  7e-29           7.000000e-029
-wip                    0.65            6.500000e-001
-wlen                   0.025625        2.562500e-002INFO: feat.c(715): Initializing feature stream to type: '1s_c_d_dd', ceplen=13,
CMN='batch', VARNORM='no', AGC='none'
INFO: acmod.c(162): Using subvector specification 0-12/13-25/26-38
INFO: mdef.c(518): Reading model definition: D:\ASR\pocketsphinx-master\model\en
-us\en-us/mdef
INFO: mdef.c(531): Found byte-order mark BMDF, assuming this is a binary mdef fi
le
INFO: bin_mdef.c(336): Reading binary model definition: D:\ASR\pocketsphinx-mast
er\model\en-us\en-us/mdef
INFO: bin_mdef.c(516): 42 CI-phone, 137053 CD-phone, 3 emitstate/phone, 126 CI-s
en, 5126 Sen, 29324 Sen-Seq
INFO: tmat.c(149): Reading HMM transition probability matrices: D:\ASR\pocketsph
inx-master\model\en-us\en-us/transition_matrices
INFO: acmod.c(113): Attempting to use PTM computation module
INFO: ms_gauden.c(127): Reading mixture gaussian parameter: D:\ASR\pocketsphinx-
master\model\en-us\en-us/means
INFO: ms_gauden.c(242): 42 codebook, 3 feature, size:
INFO: ms_gauden.c(244):  128x13
INFO: ms_gauden.c(244):  128x13
INFO: ms_gauden.c(244):  128x13
INFO: ms_gauden.c(127): Reading mixture gaussian parameter: D:\ASR\pocketsphinx-
master\model\en-us\en-us/variances
INFO: ms_gauden.c(242): 42 codebook, 3 feature, size:
INFO: ms_gauden.c(244):  128x13
INFO: ms_gauden.c(244):  128x13
INFO: ms_gauden.c(244):  128x13
INFO: ms_gauden.c(304): 222 variance values floored
INFO: ptm_mgau.c(475): Loading senones from dump file D:\ASR\pocketsphinx-master
\model\en-us\en-us/sendump
INFO: ptm_mgau.c(499): BEGIN FILE FORMAT DESCRIPTION
INFO: ptm_mgau.c(562): Rows: 128, Columns: 5126
INFO: ptm_mgau.c(594): Using memory-mapped I/O for senones
INFO: ptm_mgau.c(837): Maximum top-N: 4
INFO: phone_loop_search.c(114): State beam -225 Phone exit beam -225 Insertion p
enalty 0
INFO: dict.c(320): Allocating 138824 * 20 bytes (2711 KiB) for word entries
INFO: dict.c(333): Reading main dictionary: D:\ASR\pocketsphinx-master\model\en-
us\cmudict-en-us.dict
INFO: dict.c(213): Dictionary size 134723, allocated 1016 KiB for strings, 1679
KiB for phones
INFO: dict.c(336): 134723 words read
INFO: dict.c(358): Reading filler dictionary: D:\ASR\pocketsphinx-master\model\e
n-us\en-us/noisedict
INFO: dict.c(213): Dictionary size 134728, allocated 0 KiB for strings, 0 KiB fo
r phones
INFO: dict.c(361): 5 words read
INFO: dict2pid.c(396): Building PID tables for dictionary
INFO: dict2pid.c(406): Allocating 42^3 * 2 bytes (144 KiB) for word-initial trip
hones
INFO: dict2pid.c(132): Allocated 21336 bytes (20 KiB) for word-final triphones
INFO: dict2pid.c(196): Allocated 21336 bytes (20 KiB) for single-phone word trip
hones
INFO: ngram_model_trie.c(354): Trying to read LM in trie binary format
INFO: ngram_search_fwdtree.c(74): Initializing search tree
INFO: ngram_search_fwdtree.c(101): 791 unique initial diphones
INFO: ngram_search_fwdtree.c(186): Creating search channels
INFO: ngram_search_fwdtree.c(323): Max nonroot chan increased to 152609
INFO: ngram_search_fwdtree.c(333): Created 723 root, 152481 non-root channels, 5
3 single-phone words
INFO: ngram_search_fwdflat.c(157): fwdflat: min_ef_width = 4, max_sf_win = 25
INFO: continuous.c(307): pocketsphinx_continuous.exe COMPILED ON: Nov 20 2017, A
T: 20:33:32INFO: cmn_live.c(120): Update from < 41.00 -5.29 -0.12  5.09  2.48 -4.07 -1.37 -
1.78 -5.08 -2.05 -6.45 -1.42  1.17 >
INFO: cmn_live.c(138): Update to   < 64.76 -3.10 -9.74  0.89 -10.79 -0.03 -8.38
-4.40 -7.83  7.06 -2.24  5.81 -2.96 >
INFO: ngram_search_fwdtree.c(1550):     4674 words recognized (30/fr)
INFO: ngram_search_fwdtree.c(1552):   494454 senones evaluated (3190/fr)
INFO: ngram_search_fwdtree.c(1556):  3563622 channels searched (22991/fr), 864781st, 209626 last
INFO: ngram_search_fwdtree.c(1559):     9899 words for which last channels evalu
ated (63/fr)
INFO: ngram_search_fwdtree.c(1561):   460667 candidate words for entering last p
hone (2972/fr)
INFO: ngram_search_fwdtree.c(1564): fwdtree 3.87 CPU 2.496 xRT
INFO: ngram_search_fwdtree.c(1567): fwdtree 3.87 wall 2.495 xRT
INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 176 words
INFO: ngram_search_fwdflat.c(948):     2436 words recognized (16/fr)
INFO: ngram_search_fwdflat.c(950):   189379 senones evaluated (1222/fr)
INFO: ngram_search_fwdflat.c(952):   291055 channels searched (1877/fr)
INFO: ngram_search_fwdflat.c(954):    14721 words searched (94/fr)
INFO: ngram_search_fwdflat.c(957):    11844 word transitions (76/fr)
INFO: ngram_search_fwdflat.c(960): fwdflat 0.33 CPU 0.211 xRT
INFO: ngram_search_fwdflat.c(963): fwdflat 0.32 wall 0.209 xRT
INFO: ngram_search.c(1250): lattice start node <s>.0 end node </s>.125
INFO: ngram_search.c(1276): Eliminated 1 nodes before end node
INFO: ngram_search.c(1381): Lattice has 511 nodes, 1221 links
INFO: ps_lattice.c(1374): Bestpath score: -4996
INFO: ps_lattice.c(1378): Normalizer P(O) = alpha(</s>:125:153) = -402730
INFO: ps_lattice.c(1435): Joint P(O,S) = -415426 P(S|O) = -12696
INFO: ngram_search.c(872): bestpath 0.02 CPU 0.010 xRT
INFO: ngram_search.c(875): bestpath 0.01 wall 0.008 xRT
five five
INFO: ngram_search_fwdtree.c(429): TOTAL fwdtree 3.87 CPU 2.512 xRT
INFO: ngram_search_fwdtree.c(432): TOTAL fwdtree 3.87 wall 2.511 xRT
INFO: ngram_search_fwdflat.c(176): TOTAL fwdflat 0.33 CPU 0.213 xRT
INFO: ngram_search_fwdflat.c(179): TOTAL fwdflat 0.32 wall 0.210 xRT
INFO: ngram_search.c(303): TOTAL bestpath 0.02 CPU 0.010 xRT
INFO: ngram_search.c(306): TOTAL bestpath 0.01 wall 0.008 xRT


我们在倒数7行看到了five five。这就是识别结果。

在下一篇里面我们将介绍一下中文语音识别。

Reference:

Building an application with PocketSphinx – CMUSphinx Open Source Speech Recognition

觉得文章对你有帮助,可以用微信扫描二维码捐赠给博主,谢谢!


 

 如需转载请标明出处:http://blog.csdn.net/itas109 

QQ技术交流群:12951803

这篇关于语音识别基础篇(二) - pocketsphinx在windows下的编译和运行的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/168675

相关文章

SpringBoot基础框架详解

《SpringBoot基础框架详解》SpringBoot开发目的是为了简化Spring应用的创建、运行、调试和部署等,使用SpringBoot可以不用或者只需要很少的Spring配置就可以让企业项目快... 目录SpringBoot基础 – 框架介绍1.SpringBoot介绍1.1 概述1.2 核心功能2

使用nohup和--remove-source-files在后台运行rsync并记录日志方式

《使用nohup和--remove-source-files在后台运行rsync并记录日志方式》:本文主要介绍使用nohup和--remove-source-files在后台运行rsync并记录日... 目录一、什么是 --remove-source-files?二、示例命令三、命令详解1. nohup2.

Spring Boot项目打包和运行的操作方法

《SpringBoot项目打包和运行的操作方法》SpringBoot应用内嵌了Web服务器,所以基于SpringBoot开发的web应用也可以独立运行,无须部署到其他Web服务器中,下面以打包dem... 目录一、打包为JAR包并运行1.打包为可执行的 JAR 包2.运行 JAR 包二、打包为WAR包并运行

Spring Boot集成SLF4j从基础到高级实践(最新推荐)

《SpringBoot集成SLF4j从基础到高级实践(最新推荐)》SLF4j(SimpleLoggingFacadeforJava)是一个日志门面(Facade),不是具体的日志实现,这篇文章主要介... 目录一、日志框架概述与SLF4j简介1.1 为什么需要日志框架1.2 主流日志框架对比1.3 SLF4

Spring Boot集成Logback终极指南之从基础到高级配置实战指南

《SpringBoot集成Logback终极指南之从基础到高级配置实战指南》Logback是一个可靠、通用且快速的Java日志框架,作为Log4j的继承者,由Log4j创始人设计,:本文主要介绍... 目录一、Logback简介与Spring Boot集成基础1.1 Logback是什么?1.2 Sprin

Android NDK版本迭代与FFmpeg交叉编译完全指南

《AndroidNDK版本迭代与FFmpeg交叉编译完全指南》在Android开发中,使用NDK进行原生代码开发是一项常见需求,特别是当我们需要集成FFmpeg这样的多媒体处理库时,本文将深入分析A... 目录一、android NDK版本迭代分界线二、FFmpeg交叉编译关键注意事项三、完整编译脚本示例四

Python+Tkinter实现Windows Hosts文件编辑管理工具

《Python+Tkinter实现WindowsHosts文件编辑管理工具》在日常开发和网络调试或科学上网场景中,Hosts文件修改是每个开发者都绕不开的必修课,本文将完整解析一个基于Python... 目录一、前言:为什么我们需要专业的Hosts管理工具二、工具核心功能全景图2.1 基础功能模块2.2 进

MySQL复合查询从基础到多表关联与高级技巧全解析

《MySQL复合查询从基础到多表关联与高级技巧全解析》本文主要讲解了在MySQL中的复合查询,下面是关于本文章所需要数据的建表语句,感兴趣的朋友跟随小编一起看看吧... 目录前言:1.基本查询回顾:1.1.查询工资高于500或岗位为MANAGER的雇员,同时还要满足他们的姓名首字母为大写的J1.2.按照部门

Python中edge-tts实现便捷语音合成

《Python中edge-tts实现便捷语音合成》edge-tts是一个功能强大的Python库,支持多种语言和声音选项,本文主要介绍了Python中edge-tts实现便捷语音合成,具有一定的参考价... 目录安装与环境设置文本转语音查找音色更改语音参数生成音频与字幕总结edge-tts 是一个功能强大的

使用Python和PaddleOCR实现图文识别的代码和步骤

《使用Python和PaddleOCR实现图文识别的代码和步骤》在当今数字化时代,图文识别技术的应用越来越广泛,如文档数字化、信息提取等,PaddleOCR是百度开源的一款强大的OCR工具包,它集成了... 目录一、引言二、环境准备2.1 安装 python2.2 安装 PaddlePaddle2.3 安装