public static class Picovoice.Builder
extends java.lang.Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
Picovoice |
build(android.content.Context appContext)
Validates properties and creates an instance of the Porcupine wake word engine.
|
Picovoice.Builder |
setContextPath(java.lang.String contextPath)
Setter for path to Rhino context file
|
Picovoice.Builder |
setInferenceCallback(PicovoiceInferenceCallback inferenceCallback)
Setter for intent inference callback
|
Picovoice.Builder |
setKeywordPath(java.lang.String keywordPath)
Setter for path to Porcupine keyword file
|
Picovoice.Builder |
setPorcupineModelPath(java.lang.String porcupineModelPath)
Setter for path to Porcupine model file
|
Picovoice.Builder |
setPorcupineSensitivity(float porcupineSensitivity)
Setter for wake word engine sensitivity
|
Picovoice.Builder |
setRhinoModelPath(java.lang.String rhinoModelPath)
Setter for path to Rhino model file
|
Picovoice.Builder |
setRhinoSensitivity(float rhinoSensitivity)
Setter for inference engine sensitivity
|
Picovoice.Builder |
setWakeWordCallback(PicovoiceWakeWordCallback wakeWordCallback)
Setter for wake word detection callback
|
public Picovoice.Builder setPorcupineModelPath(java.lang.String porcupineModelPath)
porcupineModelPath - Absolute path to the file containing Porcupine's model parameters.public Picovoice.Builder setKeywordPath(java.lang.String keywordPath)
keywordPath - Absolute path to Porcupine's keyword model file.public Picovoice.Builder setPorcupineSensitivity(float porcupineSensitivity)
porcupineSensitivity - Wake word detection sensitivity. It should be a number within
[0, 1]. A higher sensitivity results in fewer misses at the cost
of increasing the false alarm rate.public Picovoice.Builder setWakeWordCallback(PicovoiceWakeWordCallback wakeWordCallback)
wakeWordCallback - User-defined callback invoked upon detection of the wake phrase.
$PicovoiceWakeWordCallback defines the interface of the
callback.public Picovoice.Builder setRhinoModelPath(java.lang.String rhinoModelPath)
rhinoModelPath - Absolute path to the file containing Rhino's model parameters.public Picovoice.Builder setContextPath(java.lang.String contextPath)
contextPath - Absolute 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.public Picovoice.Builder setRhinoSensitivity(float rhinoSensitivity)
rhinoSensitivity - Inference 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.public Picovoice.Builder setInferenceCallback(PicovoiceInferenceCallback inferenceCallback)
inferenceCallback - User-defined callback invoked upon completion of intent inference.
#PicovoiceInferenceCallback defines the interface of the
callback.public Picovoice build(android.content.Context appContext) throws PicovoiceException
appContext - Android app context (for extracting Porcupine resources)PicovoiceException - if there is an error while initializing Porcupine.