react-native-voice / voice

:microphone: React Native Voice Recognition library for iOS and Android (Online and Offline Support)
MIT License
1.82k stars 491 forks source link

"error": Object { "code": "7", "message": "7/No match", }, #405

Open CHEN-CHI-TIN opened 2 years ago

CHEN-CHI-TIN commented 2 years ago

Hi, Is that anyone solve the problem about "message": "7/No match" in android? Or anyone have the plan B about this situation? I'm about to give up...😿

Please give me some suggestion, thanks a lot.🙏

BastienSaulnier commented 2 years ago

Same issue here ...

amalraj7980 commented 1 year ago

any solutions?

hakardev commented 1 year ago

Same here

abdoutech19 commented 1 year ago

+1 same problem

NguyenMinhThien98 commented 1 year ago

+1 same problem

BastienSaulnier commented 1 year ago

The solution we found with my company is actually to copy the library code, and make your own "handcrafted Android module" based on the lib code.

You can check how to do you own Android module here : https://reactnative.dev/docs/native-modules-android

And take advantage of the SpeechRecognizer native feature of Android : https://developer.android.com/reference/android/speech/SpeechRecognizer

Also, i noticed that the "no match" error (described here : https://developer.android.com/reference/android/speech/SpeechRecognizer#ERROR_NO_MATCH with the "7" error code id ) often comes when you try nonsense speaking.

I mean, if your code is supposed to work and you say to your phone:

"Hello, i'm trying my feature" It may work.

But on the other hand, if you try garbage sentences (like I did): "Bleubleukfjdsghfjksdhkfjhdskj"

You will get a "no match" response from the lib, which is full of sense because the service won't be able to translate that to real text.

Hope this helps ;)

tayyabrajpoot12 commented 1 year ago

is there any solution?😢

Ibisobob-manuel commented 1 year ago

https://github.com/react-native-voice/voice/issues/159 be sure to have checked the "Virtual microphone uses hosta audio input" option, in Microphone options from the android emulator

pierroo commented 1 year ago

I have this error on a real device... am I the only one? :/

tayyabrajpoot12 commented 1 year ago

I have this error on a real device... am I the only one? :/

did you try this await Voice.start('es_US', { RECOGNIZER_ENGINE: 'GOOGLE', EXTRA_PARTIAL_RESULTS: true, })

pierroo commented 1 year ago

I have this error on a real device... am I the only one? :/

did you try this await Voice.start('es_US', { RECOGNIZER_ENGINE: 'GOOGLE', EXTRA_PARTIAL_RESULTS: true, })

Thank you for mentioning that; Actually the issue was just me speaking in french, when it was set to "en_US"...

However, not sure if that matters, but without your additional parameters I get two items in the array of values (both the same), whereas with it I only get one.