在kaldi 的工具集里有好几个程序可以用于在线识别。这些程序都位在src/onlinebin文件夹里,他们是由src/online文件夹里的文件编译而成(你现在可以用make ext 命令进行编译)。这些程序大多还需要tools文件夹中的portaudio 库文件支持,portaudio 库文件可以使用tools文件夹中的相应脚本文件下载安装。

# 安装portaudio
yum -y install *alsa*
cd kaldi/tools
./install_portaudio.sh
# 编译在线识别工具
cd src/
make ext

一、服务器客户端识别系统建立方法

建立整个在线识别系统需要:

  • 准备两台机器,都安装kaldi;
  • 作为服务器的机器,准备好声音模型、词典、解码网络、特征转换矩阵(我还没有使用转换矩阵)
  • 首先启动服务器,待服务器运行后,再启动客户端连接。

1. Command line to start the server(服务器端启动方式):

使用如下指令online-audio-server-decode-faster启动服务器:

online-audio-server-decode-faster --verbose=1 --rt-min=0.5 --rt-max=3.0 --max-active=6000 \
--beam=72.0 --acoustic-scale=0.0769 final.mdl graph/HCLG.fst graph/words.txt '1:2:3:4:5' \
graph/word_boundary.int 5010 final.mat

1.1 Arguments are as follow(参数意义):

  • final.mdl - the acoustic model
  • HCLG.fst - the complete FST
  • words.txt - word dictionary (mapping word ids to their textual representation)
  • '1:2:3:4:5' - list of silence phoneme ids
  • 5010 - port the server is listening on
  • word_boundary.int- a list of phoneme boundary information required for word alignemnt
  • final.mat - feature LDA matrix

注意:如果没有word_boundary.int 需要重新运行prepare_lang.sh生成。修改如下:

#原指令:
utils/prepare_lang.sh --position-dependent-phones false data/local/dict "<SPOKEN_NOISE>" \
data/local/lang data/lang
#改为:
utils/prepare_lang.sh data/local/dict "<SPOKEN_NOISE>" data/local/lang data/lang

启动后结果如下:

2. Command line to start the client(客户端启动方式):

直接运行如下指令即可启动客户端:

 online-audio-client --htk --vtt localhost 5010 scp:test.scp

2.1 Arguments are as follow(参数意义):

  • –htk - save results as an HTK label file
  • –vtt - save results as a WebVTT file
  • localhost - server to connect to
  • 5010 - port to connect to
  • scp:test.scp - list of WAV files to send

    启动后客户端不断传输数据,服务器实时进行解码!结果如下:



    结果是边传输边识别的:

* Command line to start the Java client(移动客户端):

移动客户端我还未尝试:

java -jar online-audio-client.jar

Or simply double-click the JAR file in the graphical interface.

二、使用麦克风建立客户端与服务器的实时解码

kaldi提供了读取客户端麦克风数据的解码工具,可以在客户端使用麦克风发送音频,服务器实时返回解码数据。

1. 使用online-server-gmm-decode-faster启动服务器:

  • 通过网络接收特征进行解码。话语分词是即时完成的。如果给出可选(最后)参数,则使用特征拼接/ LDA变换。 否则默认使用delta / delta-delta(2阶)特征。
Usage: online-server-gmm-decode-faster [options] model-infst-in word-symbol-table silence-phones udp-port [lda-matrix-in]
Example: online-server-gmm-decode-faster --rt-min=0.3 --rt-max=0.5 --max-active=4000 --beam=12.0 --acoustic-scale=0.0769 model HCLG.fst words.txt '1:2:3:4:5' 1234 lda-matrix

2. 使用online-net-client启动客户端:

  • 通过online-net-client工具,使用麦克风(portaudio)作为输入,提取特征并通过网络连接发送它们到服务器上。具体设置如下:
Usage: online-net-client server-address server-port 

Options:
--batch-size : The number of feature vectors to be extracted and sent in one go (int, default = 27) Standard options:
--config : Configuration file to read (this option may be repeated) (string, default = "")
--help : Print out usage message (bool, default = false)
--print-args : Print the command line arguments (to stderr) (bool, default = true)
--verbose : Verbose level (higher->more logging) (int, default = 0)

引用:kaldi-asr

转载请注明:https://www.cnblogs.com/sunhongwen/p/9437074.html

参考:kaldi首页

kaldi - Online Audio Server(服务器客户端建立方法-旧版在线解码)的更多相关文章

  1. 1. SQL Server服务器监控实现方法

    对于服务器的监控,和对数据库的监控,很少有合二为一的工具,如果有的话,一般是付费软件,或者自行开发的工具.所以如果不想购买软件,也不想花精力去开发的话,可以结合一些免费/开源的工具.自定义脚本,来完成 ...

  2. 在非SQL客户端使用命令行方式定期连接SQL Server 服务器并模拟用户查询操作,同时输出信息内容

    一个很长的标题,实现的功能就是尽量使用非人力的方式模拟人去做一件事情,为了便于记录,将他们输出成文件方便查阅. 图形界面方式,使用微软自己的ConnMaker.exe,或者Microsoft 数据连接 ...

  3. SQL Server服务器名称与默认实例名不一致的修复方法

    SQL Server服务器名称与默认实例名不一致的修复方法 分类: 个人累积 SQl SERVER 数据库复制2011-08-10 09:49 10157人阅读 评论(0) 收藏 举报 sql ser ...

  4. Openfire更服务器名称后报Found RSA certificate that is not valid for the server domain的解决方法

    原文:http://blog.sina.com.cn/s/blog_ae5a3d3f0102wdrb.html Openfire更服务器名称的方法: 1.登陆openfire管理页面,在主页面下方选择 ...

  5. SVN入门 服务器VisualSVN Server和客户端TortoiseSVN安装

    Subversion是一个版本控制系统,相对于的RCS.CVS,采用了分支管理系统,它的设计目标就是取代CVS.互联网上免费的版本控制服务多基于Subversion. 一.SVN工作原理 SVN(Su ...

  6. 【转载】Windows Server 2012服务器删除IIS方法

    在Windows Server2012版本的服务器系统中,我们可以通过服务器管理器中的"添加角色和功能"来添加IIS的Web服务器,当我们不再使用IIS功能时候,我们也可以通过删除 ...

  7. windows server 服务器添加免费域名证书的方法(Let's Encrypt)

    在 windows server 服务器上可以通过 win-acme工具添加ssl 1.首先下载工具 https://github.com/PKISharp/win-acme/releases 最新版 ...

  8. Win7 64位下sql server链接oracle的方法

    继上一次mysql同步sql server后,这一次需要将Oracle同步到sql server上来,方案相似,只是在sql server链接oracle的时候费了很多时间. 一.测试环境 本方案实现 ...

  9. GCM 发送接收消息 Message Client Server 服务器端,客户端

    GCM 传递参数 最近用了很多时间做GCM,由于碰到很多问题,因此详细做一下记录,以方便各位网友,不用再走我的重复的路.不过我试了一下GCM在国内很不好用.假如开发国外的程序的话,用GCM倒是很不错的 ...

随机推荐

  1. Linux - CentOS 7 yum方式快速安装MongoDB

    一.安装环境及配置yum # more /etc/redhat-release CentOS Linux release 7.2.1511 (Core) # vi /etc/yum.repos.d/m ...

  2. CentOS 6.8安装Ceph

    机器规划 IP 主机名 角色 10.101.0.1 ceph01 mon admin mds 10.101.0.2 ceph02 ods 10.101.0.3 ceph03 ods 10.101.0. ...

  3. mybatis调用存过程返回结果集和out参数值

    Mapper文件: 1.配置一个参数映射集,采用hashMap对象 2.使用call调用存储过,其中in out等标识的参数需要有详细的描述,例如:mode,JavaType,jdbcType等 &l ...

  4. Fax Helper

    using System; using Microsoft.Xrm.Sdk; using Microsoft.Crm.Sdk.Messages; using Microsoft.Xrm.Sdk.Que ...

  5. mysql的char,varchar,text,blob

    mysql的char,varchar,text,blob是几个有联系但是有有很大区别的字段类型,这算是mysql的基础吧,可是基础没有学好,恶补一下. 先简单的总结一下: char:定长,最大255个 ...

  6. Python学习笔记五:字符串常用操作,字典,三级菜单实例

    字符串常用操作 7月19日,7月20日 ,7月22日,7月29日,8月29日,2月29日 首字母大写:a_str.capitalize() 统计字符串个数:a_str.count(“x”) 输出字符, ...

  7. mac下使用git的冲突的解决方案

    博主之前一直是在windows系统下进行软件代码的开发,window下有很多git的使用工具,如tortoisegit等是个很好的git项目管理工具.而再mac版下的git项目代码管理工具,本人找了好 ...

  8. 深入解析Dropout

    过拟合是深度神经网(DNN)中的一个常见问题:模型只学会在训练集上分类,这些年提出的许多过拟合问题的解决方案:其中dropout具有简单性并取得良好的结果: Dropout 上图为Dropout的可视 ...

  9. js polyfill , to developing the cross browser js

    https://github.com/paulmillr/console-polyfill https://github.com/Modernizr/Modernizr/wiki/HTML5-Cros ...

  10. silverlight 图形报表开发

    前端: <UserControl x:Class="SLThree.CharReport" xmlns="http://schemas.microsoft.com/ ...