I am using react-speech-recognition for speech-to-text.
I want my code to only stop listening when the user has not spoken for 3 continuous seconds. For now, it stops listening as soon as the user stops speaking. Is there already a workaround available for this?
My cuurent implementation is const { transcript, resetTranscript, listening } = useSpeechRecognition({ commands, });
if (isUserCalling.current) { SpeechRecognition.startListening({ language: selectedLanguage }); }
My react and javascript knowledge is at the beginner level. Please do let me know if further details are needed.
For reference, I am trying to implement this repo: https://github.com/shihui-huang/react-voice-chatbot?tab=readme-ov-file