Hello @Riley-Brown!
First of all, thanks for this amazing NPM package. It has saved me a lot of time implementing my first live-voice-chat browser application.
Expected behavior: react-speech-to-text does not make the browser crash due to OOM errors after running for a long time.
Current behavior: react-speech-to-text makes the browser crash out of memory when speech recognition runs long, either in continuous or non-continuous mode. I observed crashes happen after 15min of usage with continuous transcription, or with non-continuous transcription every 30 seconds approximately.
Steps to reproduce:
const {
error: speechRecognitionError,
interimResult: speechRecognitionInterimResult,
isRecording: speechRecognitionIsRecording,
results: speechRecognitionResults,
startSpeechToText,
stopSpeechToText
} = useSpeechToText({
useLegacyResults: false,
useOnlyGoogleCloud: true,
crossBrowser: false,
continuous: false,
googleApiKey: GOOGLE_SPEECH_RECOGNITION_API_KEY,
googleCloudRecognitionConfig: {
languageCode: 'de-DE',
sampleRateHertz: 48000,
maxAlternatives: 1,
model: 'command_and_search',
}
});
-
Package version: ^0.8.0
-
Browser: Chrome version 106.0.5249.103
-
OS: Windows 11
-
Possible cause: I have not revised the package's code, but I have the impression that the audio stream used for the speech recognition stores the buffers locally as blobs, which progressively accumulate over time if they are not cleaned up. A useful StackOverflow post to successfully delete blobs might be: https://stackoverflow.com/questions/22899333/delete-javascript-blobs
Hello @Riley-Brown!
First of all, thanks for this amazing NPM package. It has saved me a lot of time implementing my first live-voice-chat browser application.
Expected behavior:
react-speech-to-textdoes not make the browser crash due to OOM errors after running for a long time.Current behavior:
react-speech-to-textmakes the browser crash out of memory when speech recognition runs long, either in continuous or non-continuous mode. I observed crashes happen after 15min of usage with continuous transcription, or with non-continuous transcription every 30 seconds approximately.Steps to reproduce:
Package version: ^0.8.0
Browser: Chrome version 106.0.5249.103
OS: Windows 11
Possible cause: I have not revised the package's code, but I have the impression that the audio stream used for the speech recognition stores the buffers locally as blobs, which progressively accumulate over time if they are not cleaned up. A useful StackOverflow post to successfully delete blobs might be: https://stackoverflow.com/questions/22899333/delete-javascript-blobs