2019独角兽企业重金招聘Python工程师标准>>>

最近在研究基于Sphinx-4的孤立词识别工作。原来没有接触过CMU Sphinx,所以想跟着里面的programming guide试一试。于是,在Intellij IDEA+Maven上加载了Sphinx-4库之后照着写了一个helloworld的demo同时也写好了XML文件。但是,当运行的时候显示如下的错误:

请各位给看看,有什么问题,还有就是有谁做过关于CMU Sphinx-4的语音识别相关工作,我有问题想要请教,多谢!

这是我的helloworld文件的java和XML文件代码:

package edu.tju.demo.sphinx.demo.helloworld;
import edu.cmu.sphinx.frontend.util.Microphone;
import edu.cmu.sphinx.recognizer.Recognizer;
import edu.cmu.sphinx.result.Result;
import edu.cmu.sphinx.util.props.ConfigurationManager;/*** A simple HelloWorld demo showing a simple speech application built using Sphinx-4. This application uses the Sphinx-4* endpointer, which automatically segments incoming audio into utterances and silences.*/
public class HelloWorld {public static void main(String[] args) {ConfigurationManager cm;if (args.length > 0) {cm = new ConfigurationManager(args[0]);} else {cm = new ConfigurationManager(HelloWorld.class.getResource("helloworld.config.xml"));}Recognizer recognizer = (Recognizer) cm.lookup("recognizer");recognizer.allocate();// start the microphone or exit if the programm if this is not possibleMicrophone microphone = (Microphone) cm.lookup("microphone");if (!microphone.startRecording()) {System.out.println("Cannot start microphone.");recognizer.deallocate();System.exit(1);}System.out.println("Say: (Good morning | Hello) ( Bhiksha | Evandro | Paul | Philip | Rita | Will )");// loop the recognition until the programm exits.while (true) {System.out.println("Start speaking. Press Ctrl-C to quit.\n");Result result = recognizer.recognize();if (result != null) {String resultText = result.getBestFinalResultNoFiller();System.out.println("You said: " + resultText + '\n');} else {System.out.println("I can't hear what you said.\n");}}}
}
<?xml version="1.0" encoding="UTF-8"?>
<config><property name="logLevel" value="WARNING"/><property name="absoluteBeamWidth" value="-1"/><property name="relativeBeamWidth" value="1E-80"/><property name="wordInsertionProbability" value="1E-36"/><property name="languageWeight" value="8"/><property name="frontend" value="epFrontEnd"/><property name="recognizer" value="recognizer"/><property name="showCreations" value="false"/><component name="recognizer" type="edu.cmu.sphinx.recognizer.Recognizer"><property name="decoder" value="decoder"/><propertylist name="monitors"><item>accuracyTracker </item><item>speedTracker </item><item>memoryTracker </item></propertylist></component><component name="decoder" type="edu.cmu.sphinx.decoder.Decoder"><property name="searchManager" value="searchManager"/></component><component name="searchManager"type="edu.cmu.sphinx.decoder.search.SimpleBreadthFirstSearchManager"><property name="logMath" value="logMath"/><property name="linguist" value="flatLinguist"/><property name="pruner" value="trivialPruner"/><property name="scorer" value="threadedScorer"/><property name="activeListFactory" value="activeList"/></component><component name="logMath" type="edu.cmu.sphinx.util.LogMath"><property name="logBase" value="1.0001"/><property name="useAddTable" value="true"/></component><component name="trivialPruner"type="edu.cmu.sphinx.decoder.pruner.SimplePruner"/><component name="threadedScorer"type="edu.cmu.sphinx.decoder.scorer.ThreadedAcousticScorer"><property name="frontend" value="${frontend}"/><property name="isCpuRelative" value="true"/><property name="numThreads" value="0"/><property name="minScoreablesPerThread" value="10"/><property name="scoreablesKeepFeature" value="true"/></component><component name="activeList"type="edu.cmu.sphinx.decoder.search.PartitionActiveListFactory"><property name="logMath" value="logMath"/><property name="absoluteBeamWidth" value="${absoluteBeamWidth}"/><property name="relativeBeamWidth" value="${relativeBeamWidth}"/></component><component name="flatLinguist"type="edu.cmu.sphinx.linguist.flat.FlatLinguist"><property name="logMath" value="logMath"/><property name="grammar" value="jsgfGrammar"/><property name="acousticModel" value="wsj"/><property name="wordInsertionProbability"value="${wordInsertionProbability}"/><property name="languageWeight" value="${languageWeight}"/></component><component name="jsgfGrammar" type="edu.cmu.sphinx.jsapi.JSGFGrammar"><property name="grammarLocation" value="resource:/demo/sphinx/helloworld/"/><property name="dictionary" value="dictionary"/><property name="grammarName" value="hello"/><property name="logMath" value="logMath"/></component><component name="dictionary"type="edu.cmu.sphinx.linguist.dictionary.FastDictionary"><property name="dictionaryPath"value="resource:/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/dict/cmudict.0.6d"/><property name="fillerPath"value="resource:/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/dict/fillerdict"/><property name="addSilEndingPronunciation" value="false"/><property name="wordReplacement" value="<sil>"/></component><component name="dictionary"type="edu.cmu.sphinx.linguist.dictionary.FastDictionary"><property name="dictionaryPath"value="resource:/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/dict/cmudict.0.6d"/><property name="fillerPath"value="resource:/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/dict/fillerdict"/><property name="addSilEndingPronunciation" value="false"/><property name="wordReplacement" value="<sil>"/></component><!-- ******************************************************** --><!-- The frontend configuration                               --><!-- ******************************************************** --><component name="frontEnd" type="edu.cmu.sphinx.frontend.FrontEnd"><propertylist name="pipeline"><item>microphone </item><item>premphasizer </item><item>windower </item><item>fft </item><item>melFilterBank </item><item>dct </item><item>liveCMN </item><item>featureExtraction </item></propertylist></component><!-- ******************************************************** --><!-- The live frontend configuration                          --><!-- ******************************************************** --><component name="epFrontEnd" type="edu.cmu.sphinx.frontend.FrontEnd"><propertylist name="pipeline"><item>microphone </item><item>speechClassifier </item><item>speechMarker </item><item>nonSpeechDataFilter </item><item>premphasizer </item><item>windower </item><item>fft </item><item>melFilterBank </item><item>dct </item><item>liveCMN </item><item>featureExtraction </item></propertylist></component><component name="speechClassifier"type="edu.cmu.sphinx.frontend.endpoint.SpeechClassifier"><property name="threshold" value="13"/></component><component name="nonSpeechDataFilter"type="edu.cmu.sphinx.frontend.endpoint.NonSpeechDataFilter"/><component name="speechMarker"type="edu.cmu.sphinx.frontend.endpoint.SpeechMarker" ><property name="speechTrailer" value="50"/></component><component name="premphasizer"type="edu.cmu.sphinx.frontend.filter.Preemphasizer"/><component name="windower"type="edu.cmu.sphinx.frontend.window.RaisedCosineWindower"></component><component name="fft"type="edu.cmu.sphinx.frontend.transform.DiscreteFourierTransform"/><component name="melFilterBank"type="edu.cmu.sphinx.frontend.frequencywarp.MelFrequencyFilterBank"></component><component name="dct"type="edu.cmu.sphinx.frontend.transform.DiscreteCosineTransform"/><component name="batchCMN"type="edu.cmu.sphinx.frontend.feature.BatchCMN"/><component name="liveCMN"type="edu.cmu.sphinx.frontend.feature.LiveCMN"/><component name="featureExtraction"type="edu.cmu.sphinx.frontend.feature.DeltasFeatureExtractor"/><component name="microphone"type="edu.cmu.sphinx.frontend.util.Microphone"><property name="msecPerRead" value="10"/><property name="closeBetweenUtterances" value="false"/></component><component name="accuracyTracker"type="edu.cmu.sphinx.instrumentation.BestPathAccuracyTracker"><property name="recognizer" value="${recognizer}"/><property name="showAlignedResults" value="false"/><property name="showRawResults" value="false"/></component><component name="memoryTracker"type="edu.cmu.sphinx.instrumentation.MemoryTracker"><property name="recognizer" value="${recognizer}"/><property name="showSummary" value="false"/><property name="showDetails" value="false"/></component><component name="speedTracker"type="edu.cmu.sphinx.instrumentation.SpeedTracker"><property name="recognizer" value="${recognizer}"/><property name="frontend" value="${frontend}"/><property name="showSummary" value="true"/><property name="showDetails" value="false"/></component>
</config>

转载于:https://my.oschina.net/jamesju/blog/85900

Intellij IDEA IDE 运行Sphinx-4 DEMO helloworld出现空...相关推荐

  1. Java SE 9:使用Eclipse和IntelliJ IDEA IDE开发和测试HelloWorld模块(第4部分)

    I have already discuss about "Java Module System" Basics in my previous posts. I'm going t ...

  2. 在Intellij IDEA中运行Vaadin应用

    在本文中,我将向您展示如何使用Intellij IDEA运行vaadin应用程序. Vaadin提供了一些用于Eclipse和Netbeans的插件. 但是对于Intellij IDEA来说,还没有插 ...

  3. UEFI 基础教程 (一) - 运行第一个APP HelloWorld

    UEFI 基础教程 (二) - 运行第一个APP HelloWorld 一.代码编写: 1.edk2/OvmfPkg/HelloWorld/HelloWorld.c: #include <Uef ...

  4. 【Node学习】—运行node服务demo

    [Node学习]-运行node服务demo 创建node文件 名字不能是node.js 复制官网的案例 启动node服务:node 文件名字.js 浏览器来访问这个服务 官网版 改写版

  5. 弃用 32 位!所有基于 IntelliJ 的 IDE 将不再支持 32 位操作系统

    整理 | 苏宓 出品 | CSDN(ID:CSDNnews) 近日,JetBrain 宣布旗下所有基于 IntelliJ 的 IDE 将停止支持 32 位操作系统,其中包括 AppCode.Clion ...

  6. Intellij 2021.3 运行应用的时候 shorten command line

    在 2021.3 版的 intellij 这个配置换了地方了. 进入你需要运行的项目,单击编辑运行配置,然后选择 Modify Options,然后选择 shorten command line 然后 ...

  7. html运行applet idea,如何在Intellij IDEA中运行Applet?

    我正在尝试为我的网络课程运行these applets.当我试图在浏览器中从链接运行它们时,它们什么都不做.所以我决定尝试在IntelliJ中编译它们,但是当我运行代码时它并没有做任何事情.没有错误消 ...

  8. idea html 插件安装,IntelliJ IDEA安装运行python插件方法

    idea 工具是我们常用的开发工具,全称:intellij idea,它的功能强大就在于我们可以添加各种插件来编写不同的代码,当然也可以用来编写python,这篇文章我们来讲解,如何用idea来安装p ...

  9. iOS11真机运行CoreML图像识别demo(Object C 版)

    前几天做了一版CoreML在模拟器上进行识别图片的demo,是使用官方推荐的swift语言编写的,今天抽空把CoreML在Object C上再基于上一版完善一些功能,实现拍照识别,相册识别.话不多说, ...

最新文章

  1. Redmonk 发布 Java 框架流行度调研结果
  2. RichTextBox的使用
  3. 2.Excel公式函数
  4. centos7将网卡名字改成eth样式
  5. OJ1068: 二进制数(C语言)
  6. 删除logs mysql_关于删除MySQL Logs的一点记录
  7. 一维数组的初始化问题
  8. neo4j中实现关键路径算法
  9. python3 证件照批量换背景
  10. 10015---技术栈
  11. pr的安装教程/基础使用
  12. FZU 1968 Twinkling lights III
  13. Typora+smms+picGo(app) 图床使用办法
  14. 基于WEB多媒体电子贺卡平台
  15. linux下使用动态壁纸
  16. Python基础:按位异或 ^ ,按位或 | ,按位与
  17. 上市公司内控信息披露指数(2000-2018年)
  18. 关于ipad mini2升级到12.5.4(问题解答)
  19. Python 编码规范(pep8)
  20. python中浅紫色和浅绿色怎么表示

热门文章

  1. mysql三高讲解(二):2.2 B+树的B的意义
  2. linux 可道云_如何搭建私有云
  3. php中高光显示的高数,[技术博客]React Native——HTML页面代码高亮数学公式解析...
  4. php 逗号千分位,PHP中number_format函数输出数字格式化,增加千分位符号
  5. python flask webapi_在将Python Flask webapi部署到azurep时遇到依赖性问题
  6. D3 selectselectAll
  7. 如何解除服务器注册,《天龙八部手游》服务器注册上限怎么办 服务器注册方法...
  8. kafka消息处理失败后如何处理_面试题:Kafka 会不会丢消息?怎么处理的?
  9. mac 黑窗口连接mysql_python操作mysql数据库
  10. c语言删除数组重复元素并升序,C语言编程题: 编写函数,从一个已经排序的数组中删去某数后,该数组仍然有序....