Crate wavv[][src]

Expand description

Very basic #![no_std] library for reading wav files.

NOTE! this library is unfinished, incomplete and still contains bugs!

use std::fs;
use std::path::Path;
use wavv::{Wave, Samples};

fn main() {
    let bytes = fs::read(Path::new("./test_files/sine_stereo_16_48000.wav")).unwrap();
	let wave = Wave::from_bytes(&bytes).unwrap();

    assert_eq!(wave.header.num_channels, 2);
    assert_eq!(wave.header.bit_depth, 16);
    assert_eq!(wave.header.sample_rate, 48_000);

    match {
        Samples::BitDepth8(samples) => println!("{:?}", samples),
        Samples::BitDepth16(samples) => println!("{:?}", samples),
        Samples::BitDepth24(samples) => println!("{:?}", samples),


Struct representing the header section of a .wav file

Struct representing a .wav file


Enum describing various .wav file data relationships

4 byte chunk IDs used in RIFF files to describe various sections of data

Error type for different parsing failures

Enum to hold samples for different bit depth