Skip to main content

load_audio_file

Function load_audio_file 

Source
pub fn load_audio_file<P>(
    loader: &mut SymphoniumLoader,
    path: P,
    target_sample_rate: Option<NonZero<u32>>,
    resample_quality: ResampleQuality,
) -> Result<DecodedAudio, LoadError>
where P: AsRef<Path>,
Expand description

A helper method to load an audio file from a path using Symphonium.

  • loader - The symphonium loader.
  • `path`` - The path to the audio file stored on disk.
  • target_sample_rate - If this is Some, then the file will be resampled to match the given target sample rate. (No resampling will occur if the audio file’s sample rate is already the target sample rate). If this is None, then the file will not be resampled and stay its original sample rate.
  • resample_quality - The quality of the resampler to use if the sample rate of the audio file doesn’t match the target_sample_rate. This has no effect if target_sample_rate is None.