create static method
- String keywordPath,
- WakeWordCallback wakeWordCallback,
- String contextPath,
- InferenceCallback inferenceCallback, {
- double porcupineSensitivity = 0.5,
- double rhinoSensitivity = 0.5,
- String? porcupineModelPath,
- String? rhinoModelPath,
- ErrorCallback? errorCallback,
Picovoice constructor
keywordPath
Absolute path to Porcupine's keyword model file.
wakeWordCallback
User-defined callback invoked upon detection of the wake phrase.
The callback accepts no input arguments.
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.
inferenceCallback
User-defined callback invoked upon completion of intent inference. The callback
accepts a single input argument of type Map<String, dynamic>
that is populated with the following items:
(2) isUnderstood
: if isFinalized, whether Rhino understood what it heard based on the context
(3) intent
: if isUnderstood, name of intent that were inferred
(4) slots
: if isUnderstood, dictionary of slot keys and values that were inferred
porcupineModelPath
Absolute path to the file containing Porcupine's model parameters.
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.
rhinoModelPath
Absolute path to the file containing Rhino's model parameters.
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.
returns an instance of the Picovoice end-to-end platform.
Implementation
static create(String keywordPath, WakeWordCallback wakeWordCallback,
String contextPath, InferenceCallback inferenceCallback,
{double porcupineSensitivity = 0.5,
double rhinoSensitivity = 0.5,
String? porcupineModelPath,
String? rhinoModelPath,
ErrorCallback? errorCallback}) {
return new PicovoiceManager._(
keywordPath,
wakeWordCallback,
contextPath,
inferenceCallback,
porcupineSensitivity,
rhinoSensitivity,
porcupineModelPath,
rhinoModelPath,
errorCallback);
}