pub fn resampling_channel_custom<T: Sample>(
resampler: impl Into<ResamplerType<T>>,
in_sample_rate: u32,
out_sample_rate: u32,
num_channels: usize,
out_max_block_frames: usize,
config: ResamplingChannelConfig,
) -> (ResamplingProd<T>, ResamplingCons<T>)Expand description
Create a new realtime-safe spsc channel for sending samples across streams using the custom resampler.
If the input and output samples rates differ, then this will automatically resample the input stream to match the output stream. If the sample rates match, then no resampling will occur.
Internally this uses the ringbuf crate.
resampler- The custom rubato resampler.in_sample_rate- The sample rate of the input stream.out_sample_rate- The sample rate of the output stream.num_channels- The number of channels in the stream.out_max_block_frames- The maximum number of frames that can be read in a single call toResamplingCons::read.config- Additional options for the resampling channel. Note thatconfig.qualitywill be ignored.
ยงPanics
Panics when any of the following are true:
resampler.num_channels() != num_channelsin_sample_rate == 0out_sample_rate == 0num_channels == 0out_max_block_frames == 0,config.latency_seconds <= 0.0config.capacity_seconds <= 0.0