1
changelog/3309.fixed.md
Normal file
1
changelog/3309.fixed.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
- Fixed a `RNNoiseFilter` issue that would cause a "[Errno 12] Cannot allocate memory" error when processing silence audio frames.
|
||||||
@@ -115,6 +115,9 @@ class RNNoiseFilter(BaseAudioFilter):
|
|||||||
if self._sample_rate != 48000 and self._resampler_in:
|
if self._sample_rate != 48000 and self._resampler_in:
|
||||||
in_audio = await self._resampler_in.resample(audio, self._sample_rate, 48000)
|
in_audio = await self._resampler_in.resample(audio, self._sample_rate, 48000)
|
||||||
|
|
||||||
|
if len(in_audio) == 0:
|
||||||
|
return audio
|
||||||
|
|
||||||
# Convert bytes to numpy array (int16)
|
# Convert bytes to numpy array (int16)
|
||||||
audio_samples = np.frombuffer(in_audio, dtype=np.int16)
|
audio_samples = np.frombuffer(in_audio, dtype=np.int16)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user