fixed_resample/
lib.rs

1#[cfg(feature = "resampler")]
2pub mod interleave;
3#[cfg(feature = "resampler")]
4mod non_realtime;
5#[cfg(feature = "resampler")]
6mod realtime;
7#[cfg(feature = "resampler")]
8mod resampler_type;
9
10#[cfg(feature = "resampler")]
11pub use non_realtime::*;
12#[cfg(feature = "resampler")]
13pub use realtime::*;
14#[cfg(feature = "resampler")]
15pub use resampler_type::*;
16
17#[cfg(feature = "channel")]
18mod channel;
19#[cfg(feature = "channel")]
20pub use channel::*;
21
22#[cfg(feature = "resampler")]
23pub use rubato;
24
25#[cfg(feature = "resampler")]
26/// The quality of the resampling algorithm to use.
27#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
28pub enum ResampleQuality {
29    /// Low quality, fast performance
30    ///
31    /// More specifically, this uses the [`FastFixedIn`] resampler from
32    /// rubato with an interpolation type of [`PolynomialDegree::Linear`]
33    /// and a chunk size of `1024`.
34    Low,
35    /// Great quality, medium performance
36    ///
37    /// This is recommended for most applications.
38    ///
39    /// More specifically, if the `fft-resampler` feature is enabled (which
40    /// it is by default), then this uses the [`FftFixedIn`] resampler from
41    /// rubato with a chunk size of `1024` and 2 sub chunks.
42    ///
43    /// If the `fft-resampler` feature is not enabled, then this will fall
44    /// back to the `Low` quality.
45    #[default]
46    Normal,
47}