CMUSphinx simplest keyword "wake word" example?

245 Views Asked by At

New to the whole sphinx4 world. Trying to get a "wake word" hello world app running off a raspberry pi 3 / Kotlin.

I think this means pocketsphinx is out because it is only android...

  • The wake word phrase is "Trick or Treat"
  • The existing demo code that I found works (thank you internets!) to recognise and output anything I say to it, with medium accuracy
  • So I could have it watching for the word "trick" - but that seems bad.
  • My understanding is that it will work a lot better and faster if I configure it to "ONLY listen for this word phrase, ignore anything else."
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()

I'm thinking I need to mess with the configuration to have a Keyword list: trick or treat /1e-30/ somewhere? Can I inline this into the code? Do I need to guess how the system may interpret muffled "trick or treat" phrases?

0

There are 0 best solutions below