Function aus::write

source ·
pub fn write(path: &str, audio: &AudioFile) -> Result<(), AudioError>
Expand description

Writes a WAV audio file to disk. Courtesy of hound. This writer will check to verify that the following are correct:

  • Number of channels matches what is present
  • Number of frames matches what is present
  • Sample rate is not 0
  • Audio format and bits per sample match
  • No sample values are out of range (sample values > 1.0 and < -1.0 are invalid)

§Example

use aus::{read, write};
let file = read("myaudio.wav").unwrap();
write("myaudio2.wav", &file);