public class Porcupine
extends java.lang.Object
getFrameLength(). The incoming audio needs to have a sample rate equal to
getSampleRate() and be 16-bit linearly-encoded. Porcupine operates on single-channel
audio.| Modifier and Type | Class and Description |
|---|---|
static class |
Porcupine.Builder
Builder for creating an instance of Porcupine with a mixture of default arguments
|
static class |
Porcupine.BuiltInKeyword |
| Modifier and Type | Method and Description |
|---|---|
void |
delete()
Releases resources acquired by Porcupine.
|
int |
getFrameLength()
Getter for number of audio samples per frame..
|
int |
getSampleRate()
Getter for audio sample rate accepted by Picovoice.
|
java.lang.String |
getVersion()
Getter for version.
|
int |
process(short[] pcm)
Processes a frame of the incoming audio stream and emits the detection result.
|
public void delete()
public int process(short[] pcm)
throws PorcupineException
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. Porcupine
operates on single-channel audio.PorcupineException - if there is an error while processing the audio frame.public java.lang.String getVersion()
public int getFrameLength()
public int getSampleRate()