Function aus::mixdown

source ·
pub fn mixdown(audiofile: &mut AudioFile)
Expand description

Mixes an audio file down to mono. This will mix all channels down to the first one, and delete the remaining channels. It is performed in-place, so you will lose data.

§Example

use aus::{AudioFile, AudioFormat};
use aus::synthesis::sine;
let waveform = sine(440.0, 0.0, 44100 * 2, 44100);
let mut channels: Vec<Vec<f64>> = Vec::with_capacity(2);
channels.push(waveform.clone());
channels.push(waveform.clone());
let mut file = AudioFile::new(AudioFormat::S24, 44100, channels);
aus::mixdown(&mut file);