xiph / rnnoise

Recurrent neural network for audio noise reduction
BSD 3-Clause "New" or "Revised" License
4.02k stars 890 forks source link

Potential underflow / overflow when converting from float to int16 #209

Open Meoo opened 2 years ago

Meoo commented 2 years ago

In the example code "rnnoise_demo", the float output is converted to a short with a simple cast

I found by experimentation that the output can be outside of int16 range, so the output should be clamped to prevent clicky noises when the input has values near the int16's min or max

lufengjie051523 commented 1 year ago

Hi,did you solved the problem?