voice
voice copied to clipboard
{"message": "7/No match"} error on Android
iOS works seamlessly perfect but on android it throws such error. i put only console.log for every event so that you can see the logs more clearly.
[Tue Mar 02 2021 14:24:26.978] LOG services: ["com.google.android.googlequicksearchbox"]
[Tue Mar 02 2021 14:24:28.464] LOG onSpeechStart: {"error": false}
[Tue Mar 02 2021 14:24:28.578] LOG onSpeechVolumeChanged: {"value": -2}
[Tue Mar 02 2021 14:24:28.817] LOG onSpeechVolumeChanged: {"value": -0.440000057220459}
[Tue Mar 02 2021 14:24:28.849] LOG onSpeechVolumeChanged: {"value": -2}
[Tue Mar 02 2021 14:24:29.360] LOG onSpeechVolumeChanged: {"value": 1.119999885559082}
[Tue Mar 02 2021 14:24:29.710] LOG onSpeechVolumeChanged: {"value": 0.039999961853027344}
[Tue Mar 02 2021 14:24:29.800] LOG onSpeechVolumeChanged: {"value": 0.7599999904632568}
[Tue Mar 02 2021 14:24:29.104] LOG onSpeechVolumeChanged: {"value": -0.440000057220459}
[Tue Mar 02 2021 14:24:29.113] LOG onSpeechVolumeChanged: {"value": 0.8799998760223389}
[Tue Mar 02 2021 14:24:29.210] LOG onSpeechVolumeChanged: {"value": 0.16000008583068848}
[Tue Mar 02 2021 14:24:29.212] LOG onSpeechVolumeChanged: {"value": 1}
[Tue Mar 02 2021 14:24:29.212] LOG onSpeechVolumeChanged: {"value": 10}
[Tue Mar 02 2021 14:24:29.469] LOG onSpeechVolumeChanged: {"value": -2}
[Tue Mar 02 2021 14:24:33.729] LOG onSpeechError: {"error": {"message": "7/No match"}}
and this is my start function with options:
Voice.start('en-US', {
RECOGNIZER_ENGINE: 'services',
EXTRA_PARTIAL_RESULTS: true,
})
any help will be appreciated, thank you
ok) it's easy, just no match )
In my case It's not so applicable to drop recognition so fast and I Ignore this error and start recognition again.
if (message === '7/No match') {
await Voice.start('en-US');
return;
}
works well, and I can wait for voice more then one minute, but with one issue, on each 6 seconds android play BIP sound
ok) it's easy, just no match )
In my case It's not so applicable to drop recognition so fast and I Ignore this error and start recognition again.
if (message === '7/No match') { await Voice.start('en-US'); return; }
works well, and I can wait for voice more then one minute, but with one issue, on each 6 seconds android play BIP sound
Interesting work around. Any insights on why this might be throwing?
Getting Same Issue. Any help?
ok) it's easy, just no match )
In my case It's not so applicable to drop recognition so fast and I Ignore this error and start recognition again.
if (message === '7/No match') { await Voice.start('en-US'); return; }
works well, and I can wait for voice more then one minute, but with one issue, on each 6 seconds android play BIP sound
This did not solve the issue for me. In my case this error is thrown within a few seconds (around 5 secs) after voice.start is called and it is not recognizing any spoken speech during that time (not calling onSpeechPartialResults / onSpeechResults / onSpeechRecognized). It is giving error each time it starts the voice. Hence going in loop if I try to start voice again when error occurs.
Hey guys! Any solution for this issue? Thanks!
Not working, getting same issue
need help on this please. still getting this issues on some android
getting the same issue
Any updates on this issue . I am also facing same issue ?
I used two refs and the onSpeechPartialResults and onSpeechEnd listeners:
const partialResults = React.useRef("")
const results = React.useRef("")
...
Voice.onSpeechResults = (e: SpeechResultsEvent) => {
if (e.value) {
// used by iOS only
setText(e.value[0])
}
}
Voice.onSpeechPartialResults = (e: SpeechResultsEvent) => {
if (e.value) {
partialResults.current = e.value[0]
}
}
Voice.onSpeechEnd = () => {
if (Platform.OS === "android") {
results.current += ` ${partialResults.current}`
partialResults.current = ""
Voice.start("en-US")
}
}
...
// in my stop recording onPress handler
if (Platform.OS === "android") {
setText(results.current)
results.current = ""
partialResults.current = ""
}
@hkhamm it seems that onSpeechResult is called after onSpeechEnd.so at the time of onSpeechEnd we dont have result yet.
This error occurs on Android when you start in parallel video recording with this library: https://mrousavy.com/react-native-vision-camera/