How to Setup VOCE (Voice Recognition API) C++

All day long I tried figuring out how to setup VOCE (http://voce.sourceforge.net).

I am using VS 2010.

What I did:

* Downloaded JDK
* Downloaded the VOCE, extracted and put in c:
* Opened VS and in properties->Vc++ Direcotories:
* In Include Directories i added: C:\voce-0.9.1\src\c++, C:\Program * Files\Java\jdk1.7.0_45\include, C:\Program Files\Java\jdk1.7.0_45\include\win32
* In Library Directories i added: C:\voce-0.9.1\lib, C:\Program * Files\Java\jdk1.7.0_45\lib

ALSO: I didn't get what i suppose to do with C:\voce-0.9.1\lib everything there * is winrars

Tried to compile a sample file and it gives me the error:
Testing.obj : error LNK2001: unresolved external symbol _imp_JNI_CreateJavaVM@12

(I googled it but everything i try didn't work)
I didn't get what i suppose to do with C:\voce-0.9.1\lib
Testing.obj : error LNK2001: unresolved external symbol _imp_JNI_CreateJavaVM@12


That should raise some red flags.

http://stackoverflow.com/questions/16261390/how-to-install-voce-for-c
That should raise some red flags.

http://stackoverflow.com/questions/16261390/how-to-install-voce-for-c


I saw this already, it didn't help. Could you try to help me in more specific way?
I'm not sure of how much help I will be. I've never worked with the JNI.
Here's the documentation in case you haven't seen that.
http://voce.sourceforge.net/files/VoceWhitePaper.pdf

Here's a paragraph from that documentation, which is relevant to your problem:

For C++ support, Voce uses the Java
Native Interface [14] to create a C++
API that can access the Java Voce
package internally. A single C++ header
file contains all necessary functions to
interface a C++ application with the Java
package. It allocates and deallocates a
Java virtual machine, looks up Java
method IDs, and calls the Java methods.

Voce’s API (which is identical in the
Java and C++ versions) was designed to
be as simple as possible, consisting of
only eight functions (see Appendix A for
a more detailed description).


If the header does what they say it does, then your problem may have something to do with the placement of your files in directories.

I don't know which compiler/IDE you're using, but I use Visual C++ 2008 express.
Depending on your compiler/IDE and OS architecture, these directories may be different.

If I were developing software with VOCE, these are the directories I would move the following files to.

Move these .jar files...
voce-0.9.1 > lib >

- cmu_us_kal.jar
- cmulex.jar
- en_us.jar
- freetts.jar
- jsapi.jar
- sphinx4.jar
- WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.jar

to

Program Files > Microsoft Visual Studio 9.0 > VC > lib

and move this header
voce-0.9.1 > src > c++ > voce.h

either to

Program Files > Microsoft Visual Studio 9.0 > VC > include

or to your project's local directory.
Last edited on
Topic archived. No new replies allowed.