msqr1 / Vosklet

A speech recognizer that can run on the browser, inspired by vosk-browser
MIT License
33 stars 1 forks source link

Rnnoise suppression algorithm before ASR #16

Closed xiz2020 closed 2 months ago

xiz2020 commented 2 months ago

A recognition process works well in a quiet environments. But not in noisy environments (street, car, etc). To improve it, my idea is to pass audio data from microphone to the rnnoise suppression algorithm, described here:

Docs: https://jmvalin.ca/demo/rnnoise/

CDN: https://www.jsdelivr.com/package/npm/@timephy/rnnoise-wasm https://www.jsdelivr.com/package/npm/@shiguredo/rnnoise-wasm?path=dist

What do you think about this is real time context? Thanks.

msqr1 commented 2 months ago

Yes, you can. Just make sure that the output audio from the noise suppression is valid for Vosklet, Float32Array with elements from -1.0 to 1.0. Doesn't the getUserMedia constraints for audio have a noiseSuppression option? You can try setting that to true.