Crate audioutils Copy item path Source AudioConvError do_resample_frames Use the Resampler
to resample audio frames from the original sample rate to a specific sample rate. do_resample_mono Use the Resampler
to resample a mono waveform from original sample rate to a specific sample rate. do_resample_stereo Use the Resampler
to resample a stereo audio from the original sample rate to a specific sample rate. dual_monos_to_monos Convert two individual mono waveforms into one mono waveform. Stereo to mono conversion. dual_monos_to_stereos Convert two individual mono waveforms into a stereo audio form. frames_to_dual_mono Convert audio frames into two individual mono waveforms. Only support two-channel audio. frames_to_interleaved_samples Convert audio frames into the interleaved samples of audio interleaved by channels. The WAV file stores PCM samples in this form. frames_to_monos Convert audio frames into every individual mono waveform. Support any channels.The param channels
is optional, if you provide it, the conversion will be a little faster than if you just give it a None.
frames_to_stereos Convert audio frames into stereo audio. Mono audio will be converted to stereo by duplicating samples. Only support 1 or 2 channels of audio. interleaved_samples_to_frames Convert the interleaved samples of audio interleaved by channels into audio frames. interleaved_samples_to_monos Convert interleaved samples into individual mono waveforms by the specified channels. interleaved_samples_to_stereos Convert interleaved samples into a stereo audio form. The interleaved samples are treated as a two-channel audio. is_same_len Check every element in the data has the same length. The length will be returned. monos_to_dual_monos Convert a mono waveform to two individual mono waveforms by duplication. Mono to stereo conversion. monos_to_frames Convert every individual mono waveform into an audio frame array. Support any channels. monos_to_interleaved_samples Convert every individual mono waveform into the interleaved samples of audio interleaved by channels. The WAV file stores PCM samples in this form. monos_to_stereos Convert mono waveform to a stereo audio form by duplication. Mono to stereo conversion. sample_conv Convert samples to another format by scaling. e.g. u8
to i16
conversion is to scale [0, 255]
into [-32768, +32767]
Upscaling is lossless. Beware, the precision of f32
is roughly the same as i24
. Convert i32
to f32
is lossy.i32
to f64
is lossless but f64
for audio processing consumes lots of memory. sample_conv_batch Convert 2D audio e.g. Audio frames or multiple mono waveforms, to another format by scaling, see sample_conv()
. stereo_conv Convert one stereo sample to another format by scaling, see sample_conv()
. stereos_conv Convert multiple stereo samples to another format by scaling, see sample_conv()
. stereos_to_dual_monos Turns a stereo audio into two individual mono waveforms. stereos_to_interleaved_samples Convert stereo audio into the interleaved samples of audio interleaved by channels. The WAV file stores PCM samples in this form. stereos_to_mono_channel Convert stereo audio to a mono waveform. Stereo to mono conversion.