#audio #file #file-format #file-io

wav

This is a crate for reading in and writing out wave files. It supports bit depths of 8, 16, and 24 bits, and any number of channels.

5 releases (3 breaking)

✓ Uses Rust 2018 edition

0.4.0 May 23, 2020
0.3.0 Mar 14, 2020
0.2.0 Mar 12, 2020
0.1.1 Jan 19, 2020
0.1.0 Jan 9, 2020

#73 in Audio

Download history 6/week @ 2020-02-09 6/week @ 2020-02-16 11/week @ 2020-02-23 33/week @ 2020-03-08 64/week @ 2020-03-15 44/week @ 2020-03-22 6/week @ 2020-03-29 20/week @ 2020-04-05 21/week @ 2020-04-12 8/week @ 2020-04-19 11/week @ 2020-04-26 22/week @ 2020-05-03 2/week @ 2020-05-10 14/week @ 2020-05-17 20/week @ 2020-05-24

81 downloads per month
Used in bae_rs

LGPL-3.0

15KB
259 lines

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

use std::fs::File;
use std::path::Path;

let mut inp_file = File::open(Path::new("data/sine.wav"))?;
let (header, data) = wav::read(&mut inp_file)?;

let mut out_file = File::create(Path::new("data/output.wav"))?;
wav::write(header, data, &mut out_file)?;

lib.rs:

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

# fn main() -> std::io::Result<()> {
use std::fs::File;
use std::path::Path;

let mut inp_file = File::open(Path::new("data/sine.wav"))?;
let (header, data) = wav::read(&mut inp_file)?;

let mut out_file = File::create(Path::new("data/output.wav"))?;
wav::write(header, data, &mut out_file)?;
# Ok(())
# }

Dependencies

~115KB