{"id":24389,"library":"pyrnnoise","title":"PyRnNoise","description":"Python wrapper for the RNN noise suppression library (RNNoise), enabling real-time speech denoising. Current version 0.4.3, maintained on GitHub.","status":"active","version":"0.4.3","language":"python","source_language":"en","source_url":"https://github.com/pengzhendong/pyrnnoise","tags":["audio","denoising","RNNoise","speech","real-time"],"install":[{"cmd":"pip install pyrnnoise","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"The package is named pyrnnoise, not rnnoise.","wrong":"import rnnoise","symbol":"RNNoise","correct":"from pyrnnoise import RNNoise"}],"quickstart":{"code":"from pyrnnoise import RNNoise\nimport soundfile as sf\n\ndenoiser = RNNoise()\ndata, samplerate = sf.read('noisy_audio.wav')\noutput = denoiser.filter(data)\nsf.write('denoised_audio.wav', output, samplerate)\n","lang":"python","description":"Load a noisy audio file, filter it with RNNoise, and save the denoised result."},"warnings":[{"fix":"Convert to float32 and ensure mono: audio = audio.astype(np.float32) / 32768.0 for int16 input.","message":"The RNNoise class expects audio data as a numpy array of shape (N,) with dtype float32. Providing int16 or multichannel data will cause silent errors or poor results.","severity":"breaking","affected_versions":"all"},{"fix":"Process the whole audio array in one call, or implement overlap-add for streaming.","message":"The filter() method expects the entire audio at once; it does not support streaming or chunked processing out of the box. Attempting to call filter() on small chunks may produce artifacts at boundaries.","severity":"gotcha","affected_versions":"all"},{"fix":"Remove the sample_rate argument; resample your audio to 48 kHz before passing to denoiser.","message":"The 'sample_rate' parameter in RNNoise constructor is deprecated and ignored; the model always operates at 48 kHz. Passing it may raise a warning in future versions.","severity":"deprecated","affected_versions":"0.4.0+"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from pyrnnoise import RNNoise'. Ensure you have version 0.4.0 or later.","cause":"Incorrect import path; often due to an older version or typo.","error":"AttributeError: module 'pyrnnoise' has no attribute 'RNNoise'"},{"fix":"Convert to mono float32: audio = audio.astype(np.float32) if audio.dtype != np.float32 else audio; if audio.ndim > 1: audio = audio.mean(axis=1).","cause":"Audio data is int16, int32, or multi-channel (2D array).","error":"RuntimeError: Input audio must be 1D array of float32"},{"fix":"Install from source: on Linux, apt install build-essential cmake; on Windows, use precompiled wheels or build manually.","cause":"Missing native dependency (RNNoise shared library). This can happen if the platform is not supported or the C library is not compiled.","error":"OSError: No such file or directory: 'librnnoise.so'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}