#file-format #file-io #file

unmaintained wav

This project is no longer maintained (and wasn’t a very well implemented project to begin with), use hound instead

10 releases (2 stable)

1.0.1 May 18, 2024
1.0.0 May 15, 2021
0.6.0 Mar 5, 2021
0.5.0 Dec 20, 2020
0.3.0 Mar 14, 2020

#147 in #file-io

Download history 10287/week @ 2024-07-28 9472/week @ 2024-08-04 11446/week @ 2024-08-11 12404/week @ 2024-08-18 11631/week @ 2024-08-25 11899/week @ 2024-09-01 12752/week @ 2024-09-08 14154/week @ 2024-09-15 14336/week @ 2024-09-22 15238/week @ 2024-09-29 12609/week @ 2024-10-06 12275/week @ 2024-10-13 16339/week @ 2024-10-20 13373/week @ 2024-10-27 17951/week @ 2024-11-03 15173/week @ 2024-11-10

62,947 downloads per month
Used in 36 crates (28 directly)

LGPL-3.0

540KB
547 lines

WAV

⚠️ THIS PROJECT IS NO LONGER MAINTAINED, USE hound INSTEAD ⚠️

This is a crate for reading in and writing out wave files. It supports uncompressed PCM bit depths of 8, 16, 24 bits, and 32bit IEEE Float formats, both with any number of channels. Unfortunately other types of data format (e.g. compressed WAVE files) are not supported. There is also no support for any metadata chunks or any chunks other than the "fmt " and "data" chunks.

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:

This is a crate for reading in and writing out wave files. It supports uncompressed PCM bit depths of 8, 16, 24 bits, and 32bit IEEE Float formats, both with any number of channels. Unfortunately other types of data format (e.g. compressed WAVE files) are not supported. There is also no support for any metadata chunks or any chunks other than the "fmt " and "data" chunks.

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)?;

Dependencies