小弟最近要用java做一款语音识别软件,想利用IBM viavoice引擎来做,可网上到处都找不到,希望哪位大虾能传给我一份,或是告诉我下载地址(IBM官方网站就算了,已经删除了)
解决方案 »
- Swing的一个问题:JLabel中如何设置ImageIcon为自动缩放啊?
- 请问java下,自定义表单现在一般采用什么技术!
- java OutputStream InputStream的使用
- 怎样定义自己的异常类并抛出异常?
- 如何通过JDBC直接访问Access数据库,不通过DSN(数据源)?
- 各位大侠: 能否列出常用的、需要熟记的类及方法吗?
- 安装了jdbc驱动以后该如何设置?????????????????????????
- 如何统计一目录下的文件个数?
- 一个简单的java问题,大家来抢分吧
- 代码没出错运行不了高手帮忙看
- 监听的问题
- applet 小程序 url构造函数那块有点问题好像 恳请大侠帮忙
import javax.speech.synthesis.*;
import java.util.Locale;public class HelloWorld_Synthesis { /**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try{
SynthesizerModeDesc temp=new SynthesizerModeDesc(Locale.ENGLISH);
Synthesizer synth=Central.createSynthesizer(temp);
if(synth==null)
synth=Central.createSynthesizer(new SynthesizerModeDesc(Locale.getDefault()));
synth.allocate();
//System.out.println("something is wrong");
synth.resume();
synth.speakPlainText("hello,world!", null);
synth.waitEngineState(Synthesizer.QUEUE_EMPTY);
synth.deallocate();
}catch(Exception e){
e.printStackTrace();
} }}
系统报错:java.lang.NullPointerException
at testSynthesis.HelloWorld_Synthesis.main(HelloWorld_Synthesis.java:19)
即 在rec.allocte()使有空指针错误
import java.util.Locale;
import java.util.ResourceBundle;
import java.util.StringTokenizer;
import javax.speech.*;
//import javax.speech.recognition.*;
import javax.speech.synthesis.*;public class TTS {
protected static boolean _DEBUG = true; // debug
static Synthesizer synth;
static ResourceBundle resources; public TTS() {
try {
// locale, resources
//if (args.length>0) Locale.setDefault(new Locale(args[0], ""));
//if (args.length>1) Locale.setDefault(new Locale(args[0], args[1]));
// dbg("locale is " + Locale.getDefault());
// create a synthesizer, speak a greeting
synth = Central.createSynthesizer(null); // myEngineListener listener = new myEngineListener();
// synth.addEngineListener(listener);
synth.allocate();
} catch (Exception e) {
e.printStackTrace();
// System.exit(-1);
} } // end ctor public static void main(String args[]) {
TTS aTTS = new TTS();
aTTS.say("hello this is a test");
} // end main // Cancel output of this Synthesizer and remove all items from the speaking queue.
public void cancelAll() {
synth.cancelAll();
} public void say(String msg) {
int chunkSize = 100;
int startPos = 0;
int endPos = 0;
int pos = 0;
while (pos <= msg.length()) {
endPos = pos + chunkSize;
if (endPos>msg.length()) endPos = msg.length();
sayChunk(msg.substring(pos,endPos));
pos = endPos+1;
}
} private void sayChunk(String msg) { try {
// synthesizer.speak(resources.getString("greeting"), null);
if (_DEBUG )System.out.println("SAY > "+msg);
mySpeakableListener aSpeakableListener = new mySpeakableListener();
synth.speak(msg, aSpeakableListener);
//synth.waitQueueEmpty();
//System.out.println("after"+synth.isQueueEmpty());
//synth.deallocate(); } catch (Exception e) {
e.printStackTrace();
System.exit(-1); }
} static void dbg(String s) {
System.out.println(s);
}}class myEngineListener implements EngineListener {
public void engineAllocated(EngineEvent e) {System.out.println("engineAllocated");}
public void engineDeallocated(EngineEvent e) {System.out.println("engineDeallocated");}
public void enginePaused(EngineEvent e) {System.out.println("enginePaused");}
public void engineResumed(EngineEvent e) {System.out.println("engineResumed");}
}class mySpeakableListener implements SpeakableListener { public void beginSpeakable(SpeakableEvent ev){
System.out.println( "BEGIN_SPEAKABLE event has occurred");} public void cancelSpeakable(SpeakableEvent ev) {
System.out.println( "CANCEL_SPEAKABLE event has occurred");} public void endSpeakable(SpeakableEvent ev) {
System.out.println( "END_SPEAKABLE event has occurred");} public void erReached(SpeakableEvent ev) {
System.out.println( "MARKER_REACHED event has occurred");} public void pauseSpeakable(SpeakableEvent ev) {
System.out.println( "PAUSE_SPEAKABLE event has occurred");} public void resumeSpeakable(SpeakableEvent ev) {
System.out.println( "RESUME_SPEAKABLE event has occurred");} public void startWord(SpeakableEvent ev) {
System.out.println( "START_WORD event has occurred");} public void topOfQueue(SpeakableEvent ev) {
System.out.println( "TOP_OF_QUEUE event has occurred");}} // end class
Exception in thread "main" java.lang.UnsatisfiedLinkError: test.WinMsgBox.showMsgBox(Ljava/lang/String;)V
at test.WinMsgBox.showMsgBox(Native Method)
at test.TestJNI.main(TestJNI.java:12)
我也不知道是哪有问题,能帮忙看看吗?是不是环境没有配置好啊
please refer to INITPORT INC. 音港公司 www.initport.com
专注在语音识别领域(ASR),
提供各个平台的语音识别软件解决方案a 运行在嵌入平台的嵌入式语音识别软件产品
(目前为国内主流手机公司以及手机设计公司提供嵌入式的语音识别解决方案.可以在目前所有的主流手机平台
(从Arm7到Arm9)实现语音识别功能. )b 运行PC机上的桌面系统语音识别软件产品
目已经有盲人上网软件使用了桌面系统的语音识别软件产品c 运行在服务器上的语音识别软件产品
这个主要是针对呼叫中心领域的应用如果有兴趣麻烦
mailto: [email protected]