werman / noise-suppression-for-voice

Noise suppression plugin based on Xiph's RNNoise
GNU General Public License v3.0
4.96k stars 232 forks source link

16000Hz? #176

Open tim-gromeyer opened 1 year ago

tim-gromeyer commented 1 year ago

Hello, is it possible to use 16000Hz? In the README it says only 48000Hz, but I can't use 48000Hz. I am trying to add noise cancellation to my voice assistant, but Vosk (the library used for speech recognition) does not work with 48000Hz, unfortunately.

zamadatix commented 1 year ago

The RNN is trained on being fed 48 kHz signals. One option for your voice assistant would be to capture audio at 48000 Hz, feed it through the noise cancellation algorithm, then downsample the resulting audio to 16 kHz to be processed by Vosk.

xJanise commented 1 year ago

the microphone i personally am using doesnt support anything above 16kHz, is there any workaround or will have have to use it with 16kHz and hope for the best?

zamadatix commented 1 year ago

It doesn't as much matter that the original data is 16 kHz as much as the format fed into the noise suppression algorithm is encoded as 48 kHz sampling. From that perspective you can still grab from the mic and feed to Vosk at 16 kHz you just need to do sample rate conversion (i.e. convert from 16 kHz to 48 kHz or vice versa) for audio coming into or going out of the noise suppression step.