Skip to content

Songbird99/wavv

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wavv

.github/workflows/main.yml Crates.io docs.rs

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("foo.wav")).unwrap();
	let wave = Wave::from_bytes(&bytes).unwrap();

    println!(
        "sample rate: {}, channels: {}, bit depth: {}",
        wave.format.sample_rate, wave.format.bit_depth, wave.format.num_channels
    );

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

About

no_std library for parsing wav files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%