当前位置: 首页 > wzjs >正文

怎么给网站做友情链接怎么做一个自己的网页

怎么给网站做友情链接,怎么做一个自己的网页,长沙企业名录黄页,永仁网站建设java使用CMU sphinx语音识别 一、pom依赖1、依赖dependency2、配置仓库repository 二、下载中文资源包1、下载中文资源包(需要其他语言的选择对应的文件夹即可),中文选择Mandarin2、将下载后的文件放到项目中3、代码-识别wav语音文件4、代码-…

java使用CMU sphinx语音识别

    • 一、pom依赖
      • 1、依赖dependency
      • 2、配置仓库repository
    • 二、下载中文资源包
      • 1、下载中文资源包(需要其他语言的选择对应的文件夹即可),中文选择Mandarin
      • 2、将下载后的文件放到项目中
      • 3、代码-识别wav语音文件
      • 4、代码-识别实时输入(本地pc未成功)
        • 4.1 测试端需要有语音输入设备

一、pom依赖

1、依赖dependency

        <!-- CMUSphinx Core Library --><dependency><groupId>edu.cmu.sphinx</groupId><artifactId>sphinx4-core</artifactId><version>5prealpha-SNAPSHOT</version></dependency><!-- CMUSphinx Data Library --><dependency><groupId>edu.cmu.sphinx</groupId><artifactId>sphinx4-data</artifactId><version>5prealpha-SNAPSHOT</version></dependency>

2、配置仓库repository

        <repository><id>snapshots-repo</id><url>https://oss.sonatype.org/content/repositories/snapshots</url><releases><enabled>false</enabled></releases><snapshots><enabled>true</enabled></snapshots></repository>

二、下载中文资源包

进入sourceforge网站下载
点击菜单Files,其中Acoustic and Language Models是语言资源包文件夹,下面还有sphinx不同版本的源码,源码中默认只包含英文资源包。
sphinx的files列表
在这里插入图片描述

1、下载中文资源包(需要其他语言的选择对应的文件夹即可),中文选择Mandarin

在这里插入图片描述
在这里插入图片描述

2、将下载后的文件放到项目中

解压后的文件
在这里插入图片描述
在这里插入图片描述

3、代码-识别wav语音文件

好像只能识别wav格式的文件,m4a试了不行,可以自行尝试看下结果

    public static void speechToTxt2() throws Exception {// 1、配置Configuration conf = new Configuration();conf.setAcousticModelPath("resource:/sphinx/zh/zh_cn.cd_cont_5000");conf.setDictionaryPath("resource:/sphinx/zh/zh_cn.dic");conf.setLanguageModelPath("resource:/sphinx/zh/zh_cn.lm.bin");System.out.println("Loading models...");//        conf.setAcousticModelPath("resource:/edu/cmu/sphinx/models/en-us/en-us");
//        conf.setDictionaryPath("resource:/edu/cmu/sphinx/models/en-us/cmudict-en-us.dict");Context context = new Context(conf);context.setLocalProperty("decoder->searchManager", "allphoneSearchManager");Recognizer recognizer = context.getInstance(Recognizer.class);InputStream stream = ParseUtil.class.getResourceAsStream("/sphinx/wav/2.wav");stream.skip(44);// Simple recognition with generic modelrecognizer.allocate();context.setSpeechSource(stream, TimeFrame.INFINITE);Result result;while ((result = recognizer.recognize()) != null) {SpeechResult speechResult = new SpeechResult(result);System.out.format("Hypothesis: %s\n", speechResult.getHypothesis());System.out.println("List of recognized words and their times:");for (WordResult r : speechResult.getWords()) {System.out.println(r);}//            System.out.println("Lattice contains "
//                    + speechResult.getLattice().getNodes().size() + " nodes");}recognizer.deallocate();}

输出结果如图
其中 Hypothesis: SIL uu o2 c j ie1 r ou3 s r ou3 x r ou1 o2 SIL 就是需要训练的内容。
我们下载的资源文件zh_cn.dic中有已经简单训练的结果
在这里插入图片描述
在这里插入图片描述

4、代码-识别实时输入(本地pc未成功)

调用时,系统能检测到在使用麦克风。但在recognizer.getResult()这行总是会报溢出错误,也有可能是输入的设备不支持,各位可以自行尝试。有结果可以评论学习一下,感谢。

    public static void speechToTxt() throws Exception {// 1、配置Configuration conf = new Configuration();conf.setAcousticModelPath("resource:/sphinx/zh/zh_cn.cd_cont_5000");conf.setDictionaryPath("resource:/sphinx/zh/zh_cn.dic");conf.setLanguageModelPath("resource:/sphinx/zh/zh_cn.lm.bin");// 2、语音识别器LiveSpeechRecognizer recognizer = new LiveSpeechRecognizer(conf);// 2.1 开始识别recognizer.startRecognition(true);// 2.2 识别结果SpeechResult result;while ((result = recognizer.getResult()) != null) {System.out.println(result.getHypothesis());}// 2.3 停止识别recognizer.stopRecognition();}
4.1 测试端需要有语音输入设备

设置-系统-声音-输入输入配置中需要有输入设备,测试麦克风可以查看此设备是否可用
在这里插入图片描述
在这里插入图片描述

http://www.dtcms.com/wzjs/35165.html

相关文章:

  • 一级a做片免费网站种子资源
  • 北京做网站多少钱蚌埠网络推广
  • 高端网站建设kgu百度竞价排名医院事件
  • 第一次开票网站建设怎么开怎么在百度上面打广告
  • 中国南昌网站建设百度如何注册公司网站
  • 使用局域网做网站企业qq邮箱
  • php能做手机网站吗网站seo入门基础教程
  • 网站服务合同范本高质量外链购买
  • 做购物网站学什么技术推广和竞价代运营
  • 河南省做网站的公司有哪些ip域名解析查询
  • 做门户网站那个系统好站长权重
  • 做网站可以用什么软件交换神器
  • 长春网站制作教程seo是哪个英文的缩写
  • 网站1g空间多大搜索引擎seo
  • 网站建设公司广告比百度好用的搜索软件
  • 网站开发背景论文长沙网站关键词排名推广公司
  • 如何做国外外贸网站有什么推广产品的渠道
  • 设计方面的网站网站推广seo教程
  • 代码编辑器做热点什么网站好扬州网络推广哪家好
  • 中国建设银行河北省分行官方网站新品推广策划方案
  • 做yield网站多少钱微信营销的方法7种
  • 德州建设局网站seo刷点击软件
  • 用wix做网站需要备案吗微信广告投放推广平台多少费用
  • 商城网站开发公司百度统计收费吗
  • 推广策略是什么优化搜索引擎的方法
  • 元做网站软件开发工程师
  • 美的网站建设水平swot分析海外网络推广服务
  • 做单页网站互联网平台推广
  • 做个什么类型网站谷歌排名
  • 企业网站模板免费下载企业网站模板哪个公司的网站制作