fromKeywords static method

Future<Porcupine> fromKeywords(
  1. List<String?>? keywords, {
  2. String? modelPath,
  3. List<double>? sensitivities,
})

Static creator for initializing Porcupine from a selection of built-in keywords

keywords is a List of (phrases) for detection. The list of available keywords can be retrieved using Porcupine.BUILT_IN_KEYWORDS

modelPath is a path to the file containing model parameters. If not set it will be set to the default location.

sensitivities sensitivities for each keywords model. A higher sensitivity reduces miss rate at the cost of potentially higher false alarm rate. Sensitivity should be a floating-point number within 0 and 1.

Thows a PvError if not initialized correctly

returns an instance of the wake word engine

Implementation

static Future<Porcupine> fromKeywords(List<String?>? keywords,
        {String? modelPath, List<double>? sensitivities}) =>
    Porcupine._create(
        keywords: keywords,
        modelPath: modelPath,
        sensitivities: sensitivities);