[][src]Crate wav

WAV

This is a crate for reading in and writing out wave files. It supports bit depths of 8, 16, and 24 bits, any number of channels, and uncompressed PCM data. Unfortunately other types of data format (e.g. compressed WAVE files) are not supported.

Example

let mut inp_file = File::open(Path::new("data/sine.wav")).unwrap();
let (header, data) = wav::read_wav(&mut inp_file).unwrap();
 
let mut out_file = File::create(Path::new("data/sine.wav")).unwrap();
wav::write_wav(header, data, &mut out_file).unwrap();

Structs

Header

Structure for the "fmt " chunk of wave files, specifying key information about the enclosed data. This struct supports only PCM data, which is to say there is no extra members for compressed format data.

Enums

BitDepth

Enum listing the supported bit-depths and containers for the samples at each depth.

Functions

read_wav

Reads in the given file and attempts to extract the audio data and header from it.

write_wav

Writes the given wav data to the given file.