audio(filters): deprecate NoisereduceFilter

This commit is contained in:
Aleix Conchillo Flaqué
2025-09-06 19:31:38 -07:00
parent 6a6a63a532
commit d7794abf21
3 changed files with 19 additions and 1 deletions

View File

@@ -33,6 +33,10 @@ class NoisereduceFilter(BaseAudioFilter):
Applies spectral gating noise reduction algorithms to suppress background
noise in audio streams. Uses the noisereduce library's default noise
reduction parameters.
.. deprecated:: 0.0.85
`NoisereduceFilter` is deprecated and will be removed in a future version.
We recommend using other real-time audio filters like `KrispFilter` or `AICFilter`.
"""
def __init__(self) -> None:
@@ -40,6 +44,17 @@ class NoisereduceFilter(BaseAudioFilter):
self._filtering = True
self._sample_rate = 0
import warnings
with warnings.catch_warnings():
warnings.simplefilter("always")
warnings.warn(
"`NoisereduceFilter` is deprecated. "
"Use other real-time audio filters like `KrispFilter` or `AICFilter`.",
DeprecationWarning,
stacklevel=2,
)
async def start(self, sample_rate: int):
"""Initialize the filter with the transport's sample rate.