Stack Exchange
Getting {"error": {"message": "7/No match"}} from @react-native-community/voice
I am working on voice to text conversion project in there I have used @react-native-community/voice library to recognize the voice. After speech start it returning {"error": {"message": "7/No match"}} error


    useEffect(() => {
      const onSpeechStart = (e) => {
        console.log("onSpeechStart")
        setStarted('√')
      };
      const onSpeechEnd = () => {
        console.log('onSpeechEnd');
        setStarted(null);
        setEnd('True');
      };
      const onSpeechError = (e) => {
        console.log('onSpeechError: ', e);
        setError(JSON.stringify(e.error));
      };
      const onSpeechResults = (e) => {
        console.log('onSpeechResults: ', e);
        setResults(e.value)
      };
      const onSpeechPartialResults = (e) => {
      console.log("onSpeechPartialResults", e)
        setPartialResults(e.value)
      };
      const onSpeechVolumeChanged = (e) => {
        console.log("onSpeechVolumeChanged", e)
        setPitch(e.value)
      };

      Voice.onSpeechStart = onSpeechStart;
      Voice.onSpeechEnd = onSpeechEnd;
      Voice.onSpeechError = onSpeechError;
      Voice.onSpeechResults = onSpeechResults;
      Voice.onSpeechPartialResults = onSpeechPartialResults;
      Voice.onSpeechVolumeChanged = onSpeechVolumeChanged;
      return () => {
        Voice.destroy().then(Voice.removeAllListeners);
        };
    }, []);

const startSpeechRecognizing = async () => {
  console.log("startSpeechRecognizing");
  setPitch('')
  setError('')
  setStarted('')
  setResults([])
  setPartialResults([])
  setEnd('')
  try {
      await Voice.start('en-US', {
        RECOGNIZER_ENGINE: 'services',
        EXTRA_PARTIAL_RESULTS: true,
      });
      } catch (e) {
      console.error(e);
    }
};
const stopSpeechRecognizing = async () => {
  console.log("stopSpeechRecognizing");
  try {
    await Voice.stop();
    setStarted(null);
  } catch (e) {
    console.error(e);
  }
};


enter image description here
Can someone please help me to resolve this issue

try to add
await Voice.start('es_US', {
RECOGNIZER_ENGINE: 'GOOGLE',
EXTRA_PARTIAL_RESULTS: true,
});
if you are testing on emulater be sure to have checked the "Virtual microphone uses hosta audio input" option, in Microphone options from the android emulator

be sure to have checked the "Virtual microphone uses hosta audio input" option, in Microphone options from the android emulator
