ResampyResampler
- class pipecat.audio.resamplers.resampy_resampler.ResampyResampler(**kwargs)[source]
Bases:
BaseAudioResampler
Audio resampler implementation using the resampy library.
- async resample(audio, in_rate, out_rate)[source]
Resamples the given audio data to a different sample rate.
This is an abstract method that must be implemented in subclasses.
- Parameters:
audio (bytes) – The audio data to be resampled, represented as a byte string.
in_rate (int) – The original sample rate of the audio data (in Hz).
out_rate (int) – The desired sample rate for the resampled audio data (in Hz).
- Returns:
The resampled audio data as a byte string.
- Return type:
bytes