voice icon indicating copy to clipboard operation
voice copied to clipboard

{"message": "7/No match"} error on Android

Open AlkanV opened this issue 3 years ago • 12 comments

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

AlkanV avatar Mar 02 '21 11:03 AlkanV

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

Hirurgo avatar Mar 31 '21 22:03 Hirurgo

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?

safaiyeh avatar Apr 01 '21 01:04 safaiyeh

Getting Same Issue. Any help?

tradebulls avatar May 19 '21 12:05 tradebulls

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.

Nikita279 avatar Jun 03 '21 17:06 Nikita279

Hey guys! Any solution for this issue? Thanks!

JJ810 avatar Jun 04 '21 13:06 JJ810

Not working, getting same issue

learncodingforweb avatar Jun 29 '21 17:06 learncodingforweb

need help on this please. still getting this issues on some android

tearjuIce avatar Jul 21 '21 01:07 tearjuIce

getting the same issue

DanielTschang avatar May 31 '22 07:05 DanielTschang

Any updates on this issue . I am also facing same issue ?

Sanath91009 avatar Jul 28 '22 22:07 Sanath91009

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 avatar Aug 04 '22 17:08 hkhamm

@hkhamm it seems that onSpeechResult is called after onSpeechEnd.so at the time of onSpeechEnd we dont have result yet.

Sanath91009 avatar Aug 04 '22 19:08 Sanath91009

This error occurs on Android when you start in parallel video recording with this library: https://mrousavy.com/react-native-vision-camera/

rusakovic avatar Aug 15 '22 18:08 rusakovic