Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we use mutil hotword with different callback? #55

Open
jackynguyen93 opened this issue Aug 12, 2017 · 1 comment
Open

Can we use mutil hotword with different callback? #55

jackynguyen93 opened this issue Aug 12, 2017 · 1 comment

Comments

@jackynguyen93
Copy link

I see that Snowboy can use mutil model and each model have their callback. Does Sonus can do the same?

@evancohen
Copy link
Owner

In a round-about way, yes. Sonus doesn't surface the last hotword with final results of an utterance, but you could do something like:

let lastKeyword = null

sonus.on('hotword', (index, keyword) => {
    lastKeyword = keyword
})

sonus.on('final-result', result => {
    if(lastKeyword == 'something'){
        //do something
    } else {
        //some other logic
    }
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants