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

wakeword: activeMin does not seem to work on android. Timeout still occurs after ~4-5 seconds regardless of what it is set to #104

Closed cdmoss closed 2 years ago

cdmoss commented 2 years ago

Describe the bug

Title says it all. Setting activeMin in the wakeword config does not increase the timeout duration past 4-5 seconds.

Your environment

Expected behavior

Going off of the activeMin API description, "The minimum length of an activation, in milliseconds, used to ignore a VAD deactivation after the wakeword." I expect that setting this to 10000 would keep Spokestack activated for at least 10 seconds after wakeword activation before deactivating.

Actual behavior

Spokestack deactivates after 4-5 seconds, regardless of what activeMin is set to.

Steps to reproduce

await Spokestack.initialize( ', // account id '', // api token { refreshModels: true, pipeline: { profile: Spokestack.PipelineProfile.TFLITE_WAKEWORD_NATIVE_ASR }, wakeword: { activeMin: 10000, filter: require('../../../../assets/tflites/filter.tflite'), detect: require('../../../../assets/tflites/detect.tflite'), encode: require('../../../../assets/tflites/encode.tflite'), }, } );

await Spokestack.start();

This is placed in a useEffect and initializes spokestack properly, everything seems to work fine except for the aforementioned issue.

I have not tested on iOS.

timmywil commented 2 years ago

Thanks for opening an issue. Perhaps we could word this differently, but activeMin and activeMax are meant to be used together. I think what you want is to increase activeMax. Have you already tried that?

cdmoss commented 2 years ago

Thanks for the response. It seems that tuning activeMax did not fix the problem. Here is my new config:

await Spokestack.initialize( , // account id , // api token { refreshModels: true, pipeline: { profile: Spokestack.PipelineProfile.TFLITE_WAKEWORD_NATIVE_ASR }, wakeword: { activeMin: 10000, activeMax: 20000, filter: require('../../../../assets/tflites/filter.tflite'), detect: require('../../../../assets/tflites/detect.tflite'), encode: require('../../../../assets/tflites/encode.tflite'), }, } );

Still getting the same behaviour, timeout after about 5 seconds.

timmywil commented 2 years ago

We discussed this and noticed you're using the native ASR. We should document this more thoroughly, but the best we can do with the native ASR is provide a hint on how long to stay open. Unfortunately, the native asr (android) does not guarantee it will be honored. You should be able to switch to Spokestack ASR. If that still doesn't work, then we can reopen this issue.