Classes | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ai.picovoice.rhino.Rhino Class Reference

Classes

class  Builder
 

Public Member Functions

void delete ()
 
void delete ()
 
String getContextInformation ()
 
String getContextInformation ()
 
native int getFrameLength ()
 
native int getFrameLength ()
 
RhinoInference getInference () throws RhinoException
 
RhinoInference getInference () throws RhinoException
 
native int getSampleRate ()
 
native int getSampleRate ()
 
native String getVersion ()
 
native String getVersion ()
 
boolean process (short[] pcm) throws RhinoException
 
boolean process (short[] pcm) throws RhinoException
 
 Rhino (String accessKey, String libraryPath, String modelPath, String contextPath, float sensitivity, boolean requireEndpoint) throws RhinoException
 

Static Public Attributes

static final String LIBRARY_PATH
 
static final String MODEL_PATH
 

Private Member Functions

native void delete (long object)
 
native void delete (long object)
 
native String getContextInfo (long object)
 
native String getContextInfo (long object)
 
native String getIntent (long object)
 
native String getIntent (long object)
 
native long init (String accessKey, String modelPath, String contextPath, float sensitivity, boolean requireEndpoint)
 
native long init (String accessKey, String modelPath, String contextPath, float sensitivity, boolean requireEndpoint)
 
native boolean isUnderstood (long object)
 
native boolean isUnderstood (long object)
 
native boolean process (long object, short[] pcm)
 
native boolean process (long object, short[] pcm)
 
native boolean reset (long object)
 
native boolean reset (long object)
 
 Rhino (String accessKey, String modelPath, String contextPath, float sensitivity, boolean requireEndpoint)
 

Private Attributes

long handle
 
final long libraryHandle
 

Static Private Attributes

static String DEFAULT_MODEL_PATH
 
static boolean isExtracted
 

Detailed Description

Android binding for Rhino Speech-to-Intent engine. It directly infers the user's intent from spoken commands in real-time. Rhino processes incoming audio in consecutive frames and indicates if the inference is finalized. When finalized, the inferred intent can be retrieved as structured data in the form of an intent string and pairs of slots and values. The number of samples per frame can be attained by calling getFrameLength() . The incoming audio needs to have a sample rate equal to getSampleRate() and be 16-bit linearly-encoded. Rhino operates on single-channel audio.

Java binding for Rhino Speech-to-Intent engine. It directly infers the user's intent from spoken commands in real-time. Rhino processes incoming audio in consecutive frames and indicates if the inference is finalized. When finalized, the inferred intent can be retrieved as structured data in the form of an intent string and pairs of slots and values. The number of samples per frame can be attained by calling getFrameLength() . The incoming audio needs to have a sample rate equal to getSampleRate() and be 16-bit linearly-encoded. Rhino operates on single-channel audio.

Definition at line 35 of file android/Rhino/rhino/src/main/java/ai/picovoice/rhino/Rhino.java.

Constructor & Destructor Documentation

◆ Rhino() [1/2]

ai.picovoice.rhino.Rhino.Rhino ( String  accessKey,
String  modelPath,
String  contextPath,
float  sensitivity,
boolean  requireEndpoint 
)
inlineprivate

Constructor.

Parameters
accessKeyAccessKey obtained from Picovoice Console (https://console.picovoice.ai/).
modelPathAbsolute path to the file containing model parameters.
contextPathAbsolute path to file containing context parameters. A context represents the set of expressions (spoken commands), intents, and intent arguments (slots) within a domain of interest.
sensitivityInference sensitivity. It should be a number within [0, 1]. A higher sensitivity value results in fewer misses at the cost of (potentially) increasing the erroneous inference rate.
requireEndpointBoolean variable to indicate if Rhino should wait for a chunk of silence before finishing inference.

Definition at line 60 of file android/Rhino/rhino/src/main/java/ai/picovoice/rhino/Rhino.java.

◆ Rhino() [2/2]

ai.picovoice.rhino.Rhino.Rhino ( String  accessKey,
String  libraryPath,
String  modelPath,
String  contextPath,
float  sensitivity,
boolean  requireEndpoint 
) throws RhinoException
inline

Constructor.

Parameters
accessKeyAccessKey obtained from Picovoice Console (https://picovoice.ai/console/)
libraryPathAbsolute path to the native Rhino library.
modelPathAbsolute path to the file containing model parameters.
contextPathAbsolute path to file containing context parameters. A context represents the set of expressions (spoken commands), intents, and intent arguments (slots) within a domain of interest.
sensitivityInference sensitivity. It should be a number within [0, 1]. A higher sensitivity value results in fewer misses at the cost of (potentially) increasing the erroneous inference rate.
requireEndpointIf set to true, Rhino requires an endpoint (chunk of silence) before finishing inference.
Exceptions
RhinoExceptionIf there is an error while initializing Rhino.

Definition at line 58 of file java/src/ai/picovoice/rhino/Rhino.java.

Member Function Documentation

◆ delete() [1/4]

void ai.picovoice.rhino.Rhino.delete ( )
inline

Releases resources acquired by Rhino.

Definition at line 71 of file android/Rhino/rhino/src/main/java/ai/picovoice/rhino/Rhino.java.

◆ delete() [2/4]

void ai.picovoice.rhino.Rhino.delete ( )
inline

Releases resources acquired by Rhino.

Definition at line 71 of file java/src/ai/picovoice/rhino/Rhino.java.

◆ delete() [3/4]

native void ai.picovoice.rhino.Rhino.delete ( long  object)
private

◆ delete() [4/4]

native void ai.picovoice.rhino.Rhino.delete ( long  object)
private

◆ getContextInfo() [1/2]

native String ai.picovoice.rhino.Rhino.getContextInfo ( long  object)
private

◆ getContextInfo() [2/2]

native String ai.picovoice.rhino.Rhino.getContextInfo ( long  object)
private

◆ getContextInformation() [1/2]

String ai.picovoice.rhino.Rhino.getContextInformation ( )
inline

Getter for context information.

Returns
Context information.

Definition at line 136 of file java/src/ai/picovoice/rhino/Rhino.java.

◆ getContextInformation() [2/2]

String ai.picovoice.rhino.Rhino.getContextInformation ( )
inline

Getter for context information.

Returns
Context information.

Definition at line 157 of file android/Rhino/rhino/src/main/java/ai/picovoice/rhino/Rhino.java.

◆ getFrameLength() [1/2]

native int ai.picovoice.rhino.Rhino.getFrameLength ( )

Getter for number of audio samples per frame.

Returns
Number of audio samples per frame.

◆ getFrameLength() [2/2]

native int ai.picovoice.rhino.Rhino.getFrameLength ( )

Getter for number of audio samples per frame.

Returns
Number of audio samples per frame.

◆ getInference() [1/2]

RhinoInference ai.picovoice.rhino.Rhino.getInference ( ) throws RhinoException
inline

Gets inference result from Rhino. If the spoken command was understood, it includes the specific intent name that was inferred, and (if applicable) slot keys and specific slot values. Should only be called after the process function returns true, otherwise Rhino has not yet reached an inference conclusion.

Returns
The result of inference as a RhinoInference object.
Exceptions
RhinoExceptionif inference retrieval fails.

Definition at line 100 of file java/src/ai/picovoice/rhino/Rhino.java.

◆ getInference() [2/2]

RhinoInference ai.picovoice.rhino.Rhino.getInference ( ) throws RhinoException
inline

Gets inference result from Rhino. If the spoken command was understood, it includes the specific intent name that was inferred, and (if applicable) slot keys and specific slot values. Should only be called after the process function returns true, otherwise Rhino has not yet reached an inference conclusion.

Returns
The result of inference as a RhinoInference object.
Exceptions
RhinoExceptionif inference retrieval fails.

Definition at line 120 of file android/Rhino/rhino/src/main/java/ai/picovoice/rhino/Rhino.java.

◆ getIntent() [1/2]

native String ai.picovoice.rhino.Rhino.getIntent ( long  object)
private

◆ getIntent() [2/2]

native String ai.picovoice.rhino.Rhino.getIntent ( long  object)
private

◆ getSampleRate() [1/2]

native int ai.picovoice.rhino.Rhino.getSampleRate ( )

Getter for audio sample rate accepted by Picovoice.

Returns
Audio sample rate accepted by Picovoice.

◆ getSampleRate() [2/2]

native int ai.picovoice.rhino.Rhino.getSampleRate ( )

Getter for audio sample rate accepted by Picovoice.

Returns
Audio sample rate accepted by Picovoice.

◆ getVersion() [1/2]

native String ai.picovoice.rhino.Rhino.getVersion ( )

Getter for version.

Returns
Version.

◆ getVersion() [2/2]

native String ai.picovoice.rhino.Rhino.getVersion ( )

Getter for version.

Returns
Version.

◆ init() [1/2]

native long ai.picovoice.rhino.Rhino.init ( String  accessKey,
String  modelPath,
String  contextPath,
float  sensitivity,
boolean  requireEndpoint 
)
private

◆ init() [2/2]

native long ai.picovoice.rhino.Rhino.init ( String  accessKey,
String  modelPath,
String  contextPath,
float  sensitivity,
boolean  requireEndpoint 
)
private

◆ isUnderstood() [1/2]

native boolean ai.picovoice.rhino.Rhino.isUnderstood ( long  object)
private

◆ isUnderstood() [2/2]

native boolean ai.picovoice.rhino.Rhino.isUnderstood ( long  object)
private

◆ process() [1/4]

native boolean ai.picovoice.rhino.Rhino.process ( long  object,
short[]  pcm 
)
private

◆ process() [2/4]

native boolean ai.picovoice.rhino.Rhino.process ( long  object,
short[]  pcm 
)
private

◆ process() [3/4]

boolean ai.picovoice.rhino.Rhino.process ( short[]  pcm) throws RhinoException
inline

Processes a frame of audio and emits a flag indicating if the inference is finalized. When finalized, getInference() should be called to retrieve the intent and slots, if the spoken command is considered valid.

Parameters
pcmA frame of audio samples. The number of samples per frame can be attained by calling getFrameLength(). The incoming audio needs to have a sample rate equal to getSampleRate() and be 16-bit linearly-encoded. Furthermore, Rhino operates on single channel audio.
Returns
Flag indicating whether the engine has finalized intent extraction.
Exceptions
RhinoExceptionif there is an error while processing the audio frame.

Definition at line 87 of file java/src/ai/picovoice/rhino/Rhino.java.

◆ process() [4/4]

boolean ai.picovoice.rhino.Rhino.process ( short[]  pcm) throws RhinoException
inline

Processes a frame of audio and emits a flag indicating if the inference is finalized. When finalized, getInference() should be called to retrieve the intent and slots, if the spoken command is considered valid.

Parameters
pcmA frame of audio samples. The number of samples per frame can be attained by calling getFrameLength(). The incoming audio needs to have a sample rate equal to getSampleRate() and be 16-bit linearly-encoded. Furthermore, Rhino operates on single channel audio.
Returns
Flag indicating whether the engine has finalized intent extraction.
Exceptions
RhinoExceptionif there is an error while processing the audio frame.

Definition at line 90 of file android/Rhino/rhino/src/main/java/ai/picovoice/rhino/Rhino.java.

◆ reset() [1/2]

native boolean ai.picovoice.rhino.Rhino.reset ( long  object)
private

◆ reset() [2/2]

native boolean ai.picovoice.rhino.Rhino.reset ( long  object)
private

Member Data Documentation

◆ DEFAULT_MODEL_PATH

String ai.picovoice.rhino.Rhino.DEFAULT_MODEL_PATH
staticprivate

◆ handle

long ai.picovoice.rhino.Rhino.handle
private

◆ isExtracted

boolean ai.picovoice.rhino.Rhino.isExtracted
staticprivate

◆ LIBRARY_PATH

final String ai.picovoice.rhino.Rhino.LIBRARY_PATH
static

Definition at line 35 of file java/src/ai/picovoice/rhino/Rhino.java.

◆ libraryHandle

final long ai.picovoice.rhino.Rhino.libraryHandle
private

Definition at line 33 of file java/src/ai/picovoice/rhino/Rhino.java.

◆ MODEL_PATH

final String ai.picovoice.rhino.Rhino.MODEL_PATH
static

Definition at line 36 of file java/src/ai/picovoice/rhino/Rhino.java.


The documentation for this class was generated from the following file:


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:15:20