Words duplication #183861
-
Select Topic AreaBug Feature AreaGeneral BodyI made the react native expo IOS mobile app. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
Why this happens: How to fix:
Example fix with react-native-voice onSpeechResults = event => {
// Use only event.value[0], which is the final result
this.setState({text: event.value[0]});
};Example with expo’s SpeechRecognition (simplified pattern): SpeechRecognition.onresult = event => {
if (event.isFinal) {
setInput(event.results[0][0].transcript);
}
}Other tips:
Summary: |
Beta Was this translation helpful? Give feedback.
hi @nameless-web-master
Why this happens:
Many speech-to-text libraries (like expo-speech, react-native-voice, SpeechRecognition API) emit partial results while you speak, then a final result at the end. If you append every event result instead of only accepting final ones, you’ll get duplicate words.
How to fix:
Example fix with react-native-voice