Closed nezuky closed 6 years ago
Usually this can be explained by an audio stream dieing. Did you install the recording dependencies?
brew install portaudio sox
I have that installed.
Awhile ago I tried a different computer, and Sonus works! Still don't know what was wrong with the first laptop, but I guess I am fine.
Edit: Could be something to do with an antivirus I had installed, maybe it was killing the task.
Since you have it working on another machine I'm going to close this issue - but I'm still curious about what was going on. If you ever get the chance to look into it more I'd be happy to help debug.
The code I am trying to run via Terminal:
const ROOT_DIR = '/Users/Patrick/Documents/sonus/' const Sonus = require('sonus') const speech = require('@google-cloud/speech')({ projectId: 'voice-assistant-123919', keyFilename: ROOT_DIR + 'voice assistant-bf4caad39894.json' })
const hotwords = [{ file: ROOT_DIR + 'jarvis.pmdl', hotword: 'jarvis' }] const language = "en-US" const sonus = Sonus.init({ hotwords, language, recordProgram: "rec" }, speech)
Sonus.start(sonus) console.log('Say "' + hotwords[0].hotword + '"...') sonus.on('hotword', (index, keyword) => console.log("!" + keyword)) sonus.on('partial-result', result => console.log("Partial", result)) sonus.on('error', error => console.log('error', error)) sonus.on('final-result', result => { console.log("Final", result) if (result.includes("stop")) { Sonus.stop() } })
console.log(
Done!
);