Files
bwavfile/README.md
2020-11-22 12:56:47 -08:00

2.8 KiB

Crates.io Crates.io GitHub last commit GitHub Workflow Status

bwavfile

Rust Wave File Reader/Writer with Broadcast-WAV, MBWF and RF64 Support

This is currently a work-in-progress!

Use


 use bwavfile::WaveReader;
 let mut r = WaveReader::open("tests/media/ff_silence.wav").unwrap();
 
 let format = r.format().unwrap();
 assert_eq!(format.sample_rate, 44100);
 assert_eq!(format.channel_count, 1);
 
 let mut frame_reader = r.audio_frame_reader().unwrap();
 let mut buffer = frame_reader.create_frame_buffer();
 
 let read = frame_reader.read_integer_frame(&mut buffer).unwrap();
 
 assert_eq!(buffer, [0i32]);
 assert_eq!(read, 1);

Note on Testing

All of the media for the integration tests is committed to the respository in zipped form. Before you can run tests, you need to cd into the tests directory and run the create_test_media.sh script. Note that one of the test files (the RF64 test case) is over four gigs in size.

Resources

Implementation of Broadcast Wave Files

  • EBU Tech 3285 (May 2011), "Specification of the Broadcast Wave Format (BWF)"

Implementation of 64-bit Wave Files

  • ITU-R 2088 (October 2019), "Long-form file format for the international exchange of audio programme materials with metadata"
  • EBU Tech 3306v1 (July 2009), "MBWF / RF64: An extended File Format for Audio"
    • No longer in force, however long-established.

Implementation of Wave format fmt chunk

Other resources