voice
voice copied to clipboard
Voice Recognition not working well in iOS , fetch only first word
Question Voice Recognition not working well in iOS , fetch only first word after that gives result , fine in android.
Same problem.
Same problem, i upgrade my react-native to 0.61.1, to work with fast reload, but now voice recognition not working
I'm also having this problem in iOS, while in Android works fine.
Me too, Voice.stop() doesn't call onSpeechEnd !!
We use cancel method to finish recognition but it fails. In order to make the library work, we filtered the throwed error
onSpeechError = e => {
console.log(e);
if(e.error.code != 'recognition_fail'){
this.setState({
error: JSON.stringify(e.error),
});
}
};
And we changed the state of end after canceling
try {
await Voice.cancel();
this.setState({
end: true,
});
} catch (e) {
//eslint-disable-next-line
console.error(e);
}
};
We need further testing on Android if it breaks it downs
Me too, Voice.stop() doesn't call onSpeechEnd !!
do you find any solutions on mine it like after call stop it hang for 5 seconds or more then onSpeechEnd will callback
Same problem here, Voice.stop() doesn't call onSpeechEnd nor does it show FinalResult: true.
@gaurav92-gs Did you solved your problem??
for some reason, I didn't fix anything and when we launch update on our app again (no change in that problem yet) it solves itself -,-
I am having the same issue on iOS real device. My device is using iOS 13.5.1 and React Native 0.63.2 and voice is using 1.1.3. Have you guys solved this issue or found a work around? Android is working fine.
I managed to make this work. I was using hook and accidentally calling destroy() in useEffect after the result is set. Now it is working properly after I updated the flow 🙂 I followed the codes from this article and managed to make it work. Please be careful that the codes in the article is not complete but can get the idea. https://medium.com/@gilshaan/speech-to-text-conversion-in-react-native-using-hooks-use-usestate-and-useeffect-c2b9de6b8a8a
Thanks @Aung-Myint-Thein for the resource! @gaurav92-gs does this help you out to close the issue?
@Aung-Myint-Thein The source code has same issue on iOS. Not working totally on iOS. only fetching first word
me too, any update
any update on this problem? im facing this too
Any update on this?
Inside the onSpeechResults function add debounce and check the result.
Inside the onSpeechResults function add debounce and check the result.
What?
Any updates here?
In IOS, it will keep returning results one by one in words. You will have to wait for 1 or 2 secs and then check the result.
Guys! I Founded a solution. For me helped changing of Language which Voice lib listen. For English should be as 'en-GB'. Not others variants. await Voice.start('en-GB'); <--- like this.
For IOS we need to add interval on speechEnd is not working.
` useEffect(() => { if (listening && isIos) { //clearing the timeout clearTimeout(clearVoicerecognisation?.current); //starting timeOut clearVoicerecognisation.current = setTimeout(() => { // alert('Closing after 3 seconds'); stopListening(); }, 3000); } }, [listening]);
useEffect(() => { // Set up event listeners Voice.onSpeechResults = event => { setSearchValue(event?.value[0]); }; Voice.onSpeechEnd = e => { console.log('closed'); stopListening(); }; return () => { // Clean up event listeners when component unmounts Voice.destroy().then(Voice.removeAllListeners); }; }, []);
const startListening = async () => { try { // Start voice recognition await Voice.start('en-US'); setSearchValue(''); } catch (error) { console.error('Error starting voice recognition:', error); } };
const stopListening = async () => { try { await Voice.stop(); clearTimeout(clearVoicerecognisation?.current); setIsListening(false); } catch (error) { console.error('Error stopping voice recognition:', error); } }; `
me too, any update?
Still waiting for a fix. Our Project depends on it.
It seems it is working for me. I have added patch work. I will share it soon.
On Fri, 3 May 2024, 5:13 pm Godwin Vinny Carole, @.***> wrote:
Still waiting for a fix. Our Project depends on it.
— Reply to this email directly, view it on GitHub https://github.com/react-native-voice/voice/issues/213#issuecomment-2092835454, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG6GMTFCFCVZOIB63YR3ZCLZANZ4XAVCNFSM4I7IL3GKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBZGI4DGNJUGU2A . You are receiving this because you commented.Message ID: @.***>