public class Picovoice
extends java.lang.Object
Picovoice detects utterances of a customizable wake word (phrase) within an incoming stream of audio in real-time. After detection of wake word, it begins to infer the user's intent from the follow-on spoken command. Upon detection of wake word and completion of voice command, it invokes user-provided callbacks to signal these events.
Picovoice processes incoming audio in consecutive frames. The number of samples per frame is
$getFrameLength(). The incoming audio needs to have a sample rate equal to
$getSampleRate() and be 16-bit linearly-encoded. Picovoice operates on single-channel
audio. It uses Porcupine wake word engine for wake word detection and Rhino Speech-to-Intent
engine for intent inference.
| Modifier and Type | Class and Description |
|---|---|
static class |
Picovoice.Builder
Builder for creating an instance of Picovoice with a mixture of default arguments
|
| Modifier and Type | Method and Description |
|---|---|
void |
delete()
Releases resources acquired.
|
java.lang.String |
getContextInformation()
Getter for the Rhino context
|
int |
getFrameLength()
Getter for number of audio samples per frame.
|
java.lang.String |
getPorcupineVersion()
Getter for the version of Porcupine
|
java.lang.String |
getRhinoVersion()
Getter for the version of Rhino
|
int |
getSampleRate()
Getter for audio sample rate accepted by Picovoice.
|
java.lang.String |
getVersion()
Getter for version.
|
void |
process(short[] pcm)
Processes a frame of the incoming audio stream.
|
public void delete()
public void process(short[] pcm)
throws PicovoiceException
pcm - A 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. Picovoice operates on
single-channel audio.PicovoiceException - if there is an error while processing the audio frame.public java.lang.String getVersion()
public int getFrameLength()
public int getSampleRate()
public java.lang.String getContextInformation()
public java.lang.String getPorcupineVersion()
public java.lang.String getRhinoVersion()