首页 > 解决方案 > CMUSphinx 最简单的关键字“唤醒词”示例?

问题描述

整个 sphinx4 世界的新手。试图在树莓派 3 / Kotlin 上运行“唤醒词”hello world 应用程序。

我认为这意味着pocketsphinx 已经出局了,因为它只是安卓系统......

val configuration = Configuration().apply {
    acousticModelPath = "resource:/edu/cmu/sphinx/models/en-us/en-us"
    dictionaryPath = "resource:/edu/cmu/sphinx/models/en-us/cmudict-en-us.dict"
    languageModelPath = "resource:/edu/cmu/sphinx/models/en-us/en-us.lm.bin"
}
val recognizer = LiveSpeechRecognizer(configuration)
recognizer.startRecognition(true)
generateSequence { recognizer.result }
    .takeWhile { "exit"!=it.hypothesis  }
    .forEachIndexed { index, speechResult ->
        println("Hypothesis $index: '${speechResult.hypothesis}'")
}
recognizer.stopRecognition()

我想我需要弄乱配置才能有一个关键字列表:trick or treat /1e-30/某处?我可以将其内联到代码中吗?我是否需要猜测系统如何解释含糊的“不给糖就捣蛋”的短语?

标签: cmusphinxsphinx4

解决方案


推荐阅读