abstract class RemiAudio::Resampler::Resampler
- RemiAudio::Resampler::Resampler
- Reference
- Object
Overview
Base class for all resamplers.
Direct Known Subclasses
- RemiAudio::Resampler::LinearResampler
- RemiAudio::Resampler::SincResampler
- RemiAudio::Resampler::ZohResampler
Defined in:
remiaudio/resampler/resampler.crInstance Method Summary
-
#channels : Int32
The number of channels this resampler works on.
-
#process(source : Array(Float32) | Slice(Float32), dest : Array(Float32) | Slice(Float32), ratio : Float64) : Tuple(Int64, Int64, Bool)
Resamples the audio data in source, writing the results into dest, using the given ratio (
targetRate / sourceRate
). -
#process(source : Array(Float64) | Slice(Float64), dest : Array(Float64) | Slice(Float64), ratio : Float64) : Tuple(Int64, Int64, Bool)
Resamples the audio data in source, writing the results into dest, using the given ratio (
targetRate / sourceRate
). -
#ratio=(value : Float64) : Nil
Sets the ratio of the resampler.
-
#reset : Nil
Resets the resampler.
Instance Method Detail
Resamples the audio data in source, writing the results into dest,
using the given ratio (targetRate / sourceRate
).
Note that this method is not implemented in CallbackResampler
classes
and will raise a NotImplementedError
if you attempt to use it with one.
Resamples the audio data in source, writing the results into dest,
using the given ratio (targetRate / sourceRate
).
Note that this method is not implemented in CallbackResampler
classes
and will raise a NotImplementedError
if you attempt to use it with one.
Sets the ratio of the resampler. This can be changed between calls to process/read data and the library will try to smoothly transition between the conversion ratio of the last call and the conversion ratio of the current call.
If the user wants to bypass this smooth transition and achieve a step
response in the conversion ratio, the #ratio=
method can be used to set
the starting conversion ratio of the next call to process/read data.
This will raise a BadRatioError
if the ratio is out of range.