Home > Back-end >  Java USES Sapi. SpVoice sowing abnormal voice: com.jacob.com.ComFailException: Invoke of: Speak Sour
Java USES Sapi. SpVoice sowing abnormal voice: com.jacob.com.ComFailException: Invoke of: Speak Sour

Time:02-20

Recently in the use of Java speech, voice integration Jacob do system after the completion of the packaged into a jar package, and distribute the jar into Windows services, launched the exception: after
com.jacob.com.ComFailException: Invoke of: SpeakSource: Description:

Have a great spirit to guide the maze!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Major broadcast voice source below
 public static void the speak (String voice) {
ActiveXComponent SAP=new ActiveXComponent (" Sapi. SpVoice ");
Try {
//the volume 0-100
SAP. SetProperty (" Volume ", the new Variant (100));
//voice reading speed - 10 to + 10
SAP. SetProperty (" Rate ", the new Variant (2));
//get execution object
Dispatch sapo=SAP. GetObject ();
//perform reading
Logger. The info (" & gt;>>>>>>> Voice speak start: "+ voice);
Dispatch. Call (sapo, "Speak," the new Variant (voice));
//close the execution object
Sapo. SafeRelease ();
} the catch (Exception e) {
Logger. The info (" * * * * * * * * * * * * * * exception: \ r \ n "+ e);
e.printStackTrace();
} the finally {
//close the application connection
SAP. SafeRelease ();
}
Logger. The info (" & gt;>>>>>>> Voice speak end... ");
}


Problem is: I'm into jars, start running under DOS is not the exception, but registered as a Windows service starts, this exception, have a great god know???????????

Environment: Windows 7 x64 system, jdk1.8, Jacob - 1.14.3 - x64. DLL

CodePudding user response:

I also encountered this problem,,, ask solved
  • Related