spokestack / react-native-spokestack

Spokestack: give your React Native app a voice interface!
https://spokestack.io
Apache License 2.0
56 stars 13 forks source link

Custom wakeword not working, spokestack word still used. #96

Closed bogdancrisu closed 3 years ago

bogdancrisu commented 3 years ago

Spokestack.initialize( clientId, clientSecret, { vadMode: 'quality', wakeword: { filter: require('./model/filter.tflite'), detect: require('./model/detect.tflite'), encode: require('./model/encode.tflite'), }, nlu: { model: require('./nlu/nlu.tflite'), vocab: require('./nlu/vocab.txt'), metadata: require('./nlu/metadata.sjson'), }, }, )

timmywil commented 3 years ago

Thanks for opening an issue. Unfortunately, this isn't a lot of info to go on. That said, I'm going to test a custom wakeword model once I fix the compilation issues with RN 0.64.

In the future, avoid posting your API key on GitHub (or committing that directly to a public repo) in order to keep it secure. I went ahead and edited this issue, but to be completely safe you could rotate the key to a new one.

timmywil commented 3 years ago

If you've replaced the files but they have the same names, you could try changing the file names or clearing the react native bundler cache with npx react-native start --reset-cache

bogdancrisu commented 3 years ago

Hi, tried both options but with no luck ...

bogdancrisu commented 3 years ago

I tried also with the CDN files, same result.

timmywil commented 3 years ago

Oh, also try setting refreshModels to true in Spokestack.initialize(). This will clear the model cache.

timmywil commented 3 years ago

That should work, and if so, I think perhaps we should set that to true in development by default.

bogdancrisu commented 3 years ago

Spokestack.initialize( clientId, clientSecret, { refreshModels: true, vadMode: 'quality', wakeword: { filter: require('./model/filtertwo.tflite'), detect: require('./model/detecttamarintwo.tflite'), encode: require('./model/encodetamarintwo.tflite'), }, nlu: { model: require('./nlu/nlu.tflite'), vocab: require('./nlu/vocab.txt'), metadata: require('./nlu/metadata.sjson'), }, }, )

Same result...

timmywil commented 3 years ago

Are you saying that it recognizes when you say "Spokestack" or that you've verified it's using the Spokestack model files included in the example instead of yours? What happens if you uninstall and reinstall the app?

bogdancrisu commented 3 years ago

It recognizes Spokestack only, I had a look in react-native-spokestack/src/index.tsx "initialize = (" and it receives my custom models. After I run the app in the simulator with npx react-native run-ios, Spokestack only recognizes the Spokstack wake word.

timmywil commented 3 years ago

Good news! I was able to reproduce your issue. I'm working on a fix and will have something for you soon.

timmywil commented 3 years ago

This does only seem to affect iOS. Android seems to work fine.

bogdancrisu commented 3 years ago

Yep, Android works perfectly.

timmywil commented 3 years ago

It's getting late here, but we'll keep working on this tomorrow. Thanks for your patience.

timmywil commented 3 years ago

We figured out the issue and will have a release of both spokestack-ios and react-native-spokestack by tomorrow.

timmywil commented 3 years ago

A fix has been released! Please try version 6.0.0.

bogdancrisu commented 3 years ago

Thanks, works like a charm :D