react-native-vosk icon indicating copy to clipboard operation
react-native-vosk copied to clipboard

onPartialResult loops one static word infinitely

Open serveroid opened this issue 6 months ago • 3 comments

In some cases, the onPartialResult event keeps firing indefinitely with the same word — even if the user says something completely different or remains silent.

The word returned is always the same, and seems to be statically selected from the passed grammar array.

When I pass a different grammar list, the looped word changes — but it's still one static word that gets locked into a loop.

Steps to reproduce:

Initialize Vosk with a grammar list (e.g. ["hola", "adios", "gracias"])

Start recognition using vosk.start({ grammar })

Say something unrelated or nothing at all

onPartialResult will keep returning the same word (e.g. "gracias") over and over again until timeout

Changing the grammar changes the static word, but the loop behavior remains

Expected behavior:

Partial results should reflect what the user says

Repeating one static word regardless of input seems incorrect

Environment:

Library: react-native-vosk

Platform: Android

Language Model: ES, RU

Vosk version: Last

Additional context:

This behavior makes voice interaction unreliable. I suspect it might be related to how grammar scoring or fallback happens internally. If there's a workaround or setting that prevents this fallback, please advise.

serveroid avatar Jun 26 '25 06:06 serveroid

You should pass [unk] with your array, ["hola", "adios", "gracias", "[unk]"]

pedrolmsin avatar Jun 26 '25 06:06 pedrolmsin

You should pass [unk] with your array, ["hola", "adios", "gracias", "[unk]"]

I do it

serveroid avatar Jun 26 '25 06:06 serveroid

When I added the grammar array, it is detecting words present in the array. Now, how can I make it dynamic?

DheerajKhush avatar Jul 02 '25 11:07 DheerajKhush