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

Result is getting overwrite while speaking after 1-2 seconds #92

Open
DivyarajsinhRana opened this issue Oct 11, 2023 · 1 comment
Open

Comments

@DivyarajsinhRana
Copy link

Result is getting overwrite while speaking after 1-2 seconds

const { listen, listening, stop } = useSpeechRecognition({
onResult: (result: any) => {
setValue(
'diagnosis',
diagnosisData?.diagnosis ? diagnosisData?.diagnosis + result : result
)
},
})

useEffect(() => {
return () => {
stop()
}
}, [])

Anyone can contribute?

@henrymcl
Copy link

henrymcl commented Oct 9, 2024

As per documentation you should set interimResults to false to only retrieve the final result.

interimResults
boolean (default: true)
SpeechRecognition can provide realtime results as it's trying to figure out the best match for the input. Set to false if you only want the final result.

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

2 participants