正确地将voce.jar导入java文件

时间:2021-06-06 13:29:38

I have downloaded a voice/text API for java from http://voce.sourceforge.net/

我从http://voce.sourceforge.net/下载了用于java的语音/文本API

However being semi new to java I am unsure how to use all these jar files in my code, have tried several things like import voce, import java.voce, package (my folder name with the voce jar inside).

但是对java来说是半新的我不确定如何在我的代码中使用所有这些jar文件,尝试了几个东西,比如import voce,import java.voce,package(我的文件夹名称里面有voce jar)。

However I am getting no luck.

但是我没有运气。

Code I am trying is

我正在尝试的代码是

import java.voce;
 public class SpeechInterface
 {
   public static void main(String[] args){
    voce.SpeechInterface.synthesize("hello world"); 

   }
 }

Error I get is that it cant find voce(since I am obviously doing this wrong). Have looked through * but was unable to find a question that answers this. I imagine there is one like this already but I can not find it. Closest I could find was the importing voce to C, but that wasn't to helpful.

我得到的错误是它找不到voce(因为我显然做错了)。已经查看了*但无法找到回答此问题的问题。我想有一个这样的已经但我找不到它。我能找到的最近的是导入voce到C,但这并没有帮助。

The jar file is in same directory as the java file.

jar文件与java文件位于同一目录中。

2 个解决方案

#1


2  

try using

import voce.*

If you look at http://voce.sourceforge.net/api/java/_speech_interface_8java-source.html

如果你看看http://voce.sourceforge.net/api/java/_speech_interface_8java-source.html

It mentions the package as (package voce).

它提到包裹(包voce)。

#2


0  

Here under the Tab no 10. You can find how to add a Jar file to Dr.Java IDE,

在选项卡10下面。您可以找到如何将Jar文件添加到Dr.Java IDE,

Then as Kakarot Mention , you should to write

然后作为Kakarot提及,你应该写

import.voce.*;

if you need all the classes of package voce, or write

如果你需要所有类的包voce,或写

 import.voce.classname

to import a specific class.

导入特定的类。

#1


2  

try using

import voce.*

If you look at http://voce.sourceforge.net/api/java/_speech_interface_8java-source.html

如果你看看http://voce.sourceforge.net/api/java/_speech_interface_8java-source.html

It mentions the package as (package voce).

它提到包裹(包voce)。

#2


0  

Here under the Tab no 10. You can find how to add a Jar file to Dr.Java IDE,

在选项卡10下面。您可以找到如何将Jar文件添加到Dr.Java IDE,

Then as Kakarot Mention , you should to write

然后作为Kakarot提及,你应该写

import.voce.*;

if you need all the classes of package voce, or write

如果你需要所有类的包voce,或写

 import.voce.classname

to import a specific class.

导入特定的类。