2 unstable releases

0.2.0 Mar 18, 2022
0.1.0 Feb 27, 2022

#40 in #wav

Download history 37/week @ 2024-02-16 21/week @ 2024-02-23 15/week @ 2024-03-01 17/week @ 2024-03-08 25/week @ 2024-03-15

59 downloads per month

MIT license

12KB
258 lines

waverly

Waverly is a Rust library that allows for easy parsing and writing of WAV files with the primary goal of providing access to all metadata within a WAV file, not just the format and data chunks. It's secondary goal is to support no_std. If you only care about the data chunk already formatted as samples, there are plenty of good alternatives.

use std::fs::File;
use std::io::Cursor;
use waverly::Wave;

fn main() -> Result<(), waverly::WaverlyError> {
    let file = File::open("./meta/16bit-2ch-float-peak.wav")?;
    let wave: Wave = Wave::from_reader(file)?;

    let mut virt_file = Cursor::new(Vec::new());
    wave.write(&mut virt_file)?;
    Ok(())
}

TODO

  • Parse/read and write WAV files
  • FORMAT chunk
  • DATA chunk
  • PEAK chunk
  • FACT chunk
  • no_std support
  • Single pass generation of samples in any bit depth
  • Most metadata in WAV can be generated without user input, do so where possible on write.
  • Feature to skip or target chunks
  • CUE POINT chunk
  • PLAYLIST chunk
  • Support PEAK chunk when channels are not equal to 2
  • Better support for extensible modes
  • Better error messages when binary doesn't align with chunks
  • ATests for additional chunks, extensible modes, no_std

Further reading

Multimedia Programming Interface and Data Specifications, starting on page 56

Dependencies

~1.5MB
~39K SLoC