audio(filters): deprecate NoisereduceFilter
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user