【问题标题】:how can I add a wake up word using flutter speech recognition plugin如何使用颤振语音识别插件添加唤醒词
【发布时间】:2021-03-16 23:09:36
【问题描述】:

我正在使用 Flutter 语音识别插件,效果非常好。但是,它一直在听,我希望有一个唤醒词,以便它只在我需要时才听。

此刻它一直在听,直到一片寂静。有没有办法让我缩短听的时间?这样它就可以一次只听一个单词并等待我设置的任何唤醒词。

【问题讨论】:

  • 可能会创建一个变量,该变量等于几种唤醒词。然后创建类似如果检测到唤醒词,然后输入或继续。
  • 豪猪唤醒词识别有一个Flutter插件:pub.dev/packages/porcupine

标签: flutter speech-recognition


【解决方案1】:

您可以使用porcupine 包添加唤醒词。

首先创建你的 PorcupineManager:

 Future<void> createPorcupineManager() async {
try {
  porcupineManager = await PorcupineManager.fromKeywords(Porcupine.BUILT_IN_KEYWORDS, wakeWordCallback);
  } on PvError catch (err) {
    // handle porcupine init error
    print('Porcupine error: ' + err.message);
  }
}

然后开始监听唤醒词:

Future<void> listenForWakeWord() async {
try {
  await porcupineManager.start();
} on PvAudioException catch (ex) {
  // deal with either audio exception
  print('PvAudioException: ' + ex.message);
  }
}

PorcuineManager 带有一个不错的内置唤醒词列表,我在这里列出:

  • “alexa”
  • “美式”
  • “蓝莓”
  • “大黄蜂”
  • “计算机”
  • “葡萄柚”
  • “蚱蜢”
  • “嘿谷歌”
  • “嘿 siri”
  • “贾维斯”
  • “好的谷歌”
  • “微微语音”
  • “豪猪”
  • “终结者”

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-01
    • 1970-01-01
    • 2021-10-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多