This PR adds a new class to pedalboard.io, called StreamResampler. Like it says on the tin, StreamResampler allows for resampling (changing the sample rate of) audio streams. It does so in a way that uses a constant amount of memory; meaning it can be used to resample infinite streams without requiring all of the audio to be present at once.
Like its plugin-based cousin, pedalboard.Resample, StreamResampler accepts a Resample.Quality argument to control the processing speed and quality of the resampling operation. Unlike Resample, StreamResampler accepts audio at a source_sample_rate and outputs audio at a target_sample_rate; i.e.: changing the sample rate of the audio stream, rather than just degrading the stream's quality. (see https://github.com/spotify/pedalboard/issues/82; hi @nukelash!) As such, it is not a Plugin, and cannot be inserted into Pedalboard instances, but does have process and reset methods.
This PR adds a new class to
pedalboard.io
, calledStreamResampler
. Like it says on the tin,StreamResampler
allows for resampling (changing the sample rate of) audio streams. It does so in a way that uses a constant amount of memory; meaning it can be used to resample infinite streams without requiring all of the audio to be present at once.Like its plugin-based cousin,
pedalboard.Resample
,StreamResampler
accepts aResample.Quality
argument to control the processing speed and quality of the resampling operation. UnlikeResample
,StreamResampler
accepts audio at asource_sample_rate
and outputs audio at atarget_sample_rate
; i.e.: changing the sample rate of the audio stream, rather than just degrading the stream's quality. (see https://github.com/spotify/pedalboard/issues/82; hi @nukelash!) As such, it is not aPlugin
, and cannot be inserted intoPedalboard
instances, but does haveprocess
andreset
methods.