Main Page | Namespace List | File List | Namespace Members | File Members

voce.h File Reference

#include <jni.h>
#include <iostream>
#include <string>

Go to the source code of this file.

Namespaces

namespace  voce
namespace  voce::internal

Functions

void log (const std::string &msgType, const std::string &msg)
jmethodID loadJavaMethodID (const std::string &functionName, const std::string &functionSignature)
void init (const std::string &vocePath, bool initSynthesis, bool initRecognition, const std::string &grammarPath, const std::string &grammarName)
void destroy ()
void synthesize (const std::string &message)
void stopSynthesizing ()
int getRecognizerQueueSize ()
std::string popRecognizedString ()
void setRecognizerEnabled (bool e)
bool isRecognizerEnabled ()

Variables

const std::string pathSeparator = ":"
JNIEnv * gEnv = NULL
JavaVM * gJVM = NULL
jclass gClass = NULL
jmethodID gInitID = NULL
jmethodID gDestroyID = NULL
jmethodID gSynthesizeID = NULL
jmethodID gStopSynthesizingID = NULL
jmethodID gGetRecognizerQueueSizeID = NULL
jmethodID gPopRecognizedStringID = NULL
jmethodID gSetRecognizerEnabledID = NULL
jmethodID gIsRecognizerEnabledID = NULL
const std::string gClassName = "voce/SpeechInterface"


Function Documentation

void destroy  ) 
 

In addition to the usual Java Voce destroy call, this function performs some extra stuff needed to destroy the virtual machine.

Definition at line 259 of file voce.h.

References voce::internal::log().

int getRecognizerQueueSize  ) 
 

Returns the number of recognized strings currently in the recognizer's queue.

Definition at line 331 of file voce.h.

References voce::internal::log().

void init const std::string &  vocePath,
bool  initSynthesis,
bool  initRecognition,
const std::string &  grammarPath,
const std::string &  grammarName
 

Initializes Voce. This function performs some extra stuff needed to setup the Java virtual machine and cache the Java method IDs. The 'vocePath' argument is the path to the Voce class files and config file. This path can be absolute or relative to the working directory of the executable using Voce. See documentation for the Java version for an explanation of the rest of the parameters.

Definition at line 132 of file voce.h.

References voce::internal::loadJavaMethodID(), and voce::internal::log().

bool isRecognizerEnabled  ) 
 

Returns true if the recognizer is currently enabled.

Definition at line 385 of file voce.h.

References voce::internal::log().

jmethodID loadJavaMethodID const std::string &  functionName,
const std::string &  functionSignature
 

Finds and returns a method ID for the given function name and Java method signature.

Definition at line 89 of file voce.h.

References voce::internal::gClass, voce::internal::gEnv, and voce::internal::log().

Referenced by voce::init().

void log const std::string &  msgType,
const std::string &  msg
 

A simple message logging function. The message type gets printed before the actual message.

Definition at line 75 of file voce.h.

Referenced by voce::destroy(), voce::getRecognizerQueueSize(), voce::init(), voce::isRecognizerEnabled(), voce::internal::loadJavaMethodID(), voce::popRecognizedString(), voce::setRecognizerEnabled(), voce::stopSynthesizing(), and voce::synthesize().

std::string popRecognizedString  ) 
 

Returns and removes the oldest recognized string from the recognizer's queue.

Definition at line 346 of file voce.h.

References voce::internal::log().

void setRecognizerEnabled bool  e  ) 
 

Enables and disables the speech recognizer.

Definition at line 371 of file voce.h.

References voce::internal::log().

void stopSynthesizing  ) 
 

Tells the speech synthesizer to stop synthesizing. This cancels all pending messages.

Definition at line 316 of file voce.h.

References voce::internal::log().

void synthesize const std::string &  message  ) 
 

Requests that the given string be synthesized as soon as possible.

Definition at line 298 of file voce.h.

References voce::internal::log().


Variable Documentation

jclass voce::internal::gClass = NULL
 

Global reference to the main Voce Java class.

Definition at line 57 of file voce.h.

Referenced by voce::internal::loadJavaMethodID().

const std::string voce::internal::gClassName = "voce/SpeechInterface"
 

The name of the main Voce Java class.

Definition at line 71 of file voce.h.

jmethodID voce::internal::gDestroyID = NULL
 

Definition at line 62 of file voce.h.

JNIEnv* voce::internal::gEnv = NULL
 

Global instance of the JNI environment.

Definition at line 51 of file voce.h.

Referenced by voce::internal::loadJavaMethodID().

jmethodID voce::internal::gGetRecognizerQueueSizeID = NULL
 

Definition at line 65 of file voce.h.

jmethodID voce::internal::gInitID = NULL
 

Global references to the various Java method IDs. Storing these saves lookup time later.

Definition at line 61 of file voce.h.

jmethodID voce::internal::gIsRecognizerEnabledID = NULL
 

Definition at line 68 of file voce.h.

JavaVM* voce::internal::gJVM = NULL
 

Global instance of the Java virtual machine.

Definition at line 54 of file voce.h.

jmethodID voce::internal::gPopRecognizedStringID = NULL
 

Definition at line 66 of file voce.h.

jmethodID voce::internal::gSetRecognizerEnabledID = NULL
 

Definition at line 67 of file voce.h.

jmethodID voce::internal::gStopSynthesizingID = NULL
 

Definition at line 64 of file voce.h.

jmethodID voce::internal::gSynthesizeID = NULL
 

Definition at line 63 of file voce.h.

const std::string voce::pathSeparator = ":"
 

Definition at line 44 of file voce.h.


Generated on Wed Aug 3 16:23:08 2005 for Voce C++ API by  doxygen 1.4.1