Riley-Brown / react-speech-to-text

React Hooks for Speech to Text
MIT License
118 stars 31 forks source link

Browser runs out of memory after speech recognition runs for too long #36

Open MarkCarbonell98 opened 2 years ago

MarkCarbonell98 commented 2 years ago

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:

Riley-Brown commented 2 years ago

Hi @MarkCarbonell98 glad you are finding this package useful.

Do you currently make use of the speechBlob in the results array? A possible solution to this memory problem could be adding an option to prevent saving the speechBlob if you do not need it

prabathFC commented 10 months ago

Yes, I'm using the package and face the same issue. I think its better if you can introduce an input param to clear the speechBlob. If so then it will be useful.