Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
AlkanV opened this issue Mar 2, 2021 · 12 comments
Open

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

AlkanV opened this issue Mar 2, 2021 · 12 comments

Comments

@AlkanV
Copy link

AlkanV commented Mar 2, 2021

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

@Hirurgo
Copy link

Hirurgo commented Mar 31, 2021

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

@safaiyeh
Copy link
Member

safaiyeh commented Apr 1, 2021

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?

@tradebulls
Copy link

Getting Same Issue. Any help?

@Nikita279
Copy link

Nikita279 commented Jun 3, 2021

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.

@JJ810
Copy link

JJ810 commented Jun 4, 2021

Hey guys! Any solution for this issue? Thanks!

@learncodingforweb
Copy link

Not working, getting same issue

@tearjuIce
Copy link

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

@DanielTschang
Copy link

getting the same issue

@Sanath91009
Copy link

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

@hkhamm
Copy link

hkhamm commented Aug 4, 2022

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 = ""
}

@Sanath91009
Copy link

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

@rusakovic
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests