From 2780bfb31b13b51223c28a62d0390148505fbb6d Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sat, 2 Jan 2021 15:44:05 -0800 Subject: [PATCH 1/6] Structuring Readme --- README.md | 80 ++++++++++++--------------------------- src/audio_frame_reader.rs | 4 ++ 2 files changed, 29 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index 8688f74..9b11bc0 100644 --- a/README.md +++ b/README.md @@ -4,72 +4,42 @@ [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/iluvcapra/bwavfile/Rust)](https://github.com/iluvcapra/bwavfile/actions?query=workflow%3ARust) # bwavfile -Rust Wave File Reader/Writer with Broadcast-WAV, MBWF and RF64 Support +Wave File Reader/Writer library in Rust, with Broadcast-WAV, MBWF and RF64 Support -### Features +## Features -This is currently a work-in-progress! However many features presently work: +__bwavfile__ provides a reader `WaveReader` and writer type `WaveWriter` for +reading and creating new audio files respectively. -| Feature |Read |Write| -|---------------------------------------|:---:|:-----:| -| Standard .wav files | ☑️ | ☑️ | -| Transparent promotion to RF64/BW64 | ☑️ | ☑️ | -| Unified interface for regular and extended Wave format | ☑️ | ☑️ | -| Channel/speaker map metadata | ☑️ | ☑️ | -| Ambisonic B-format metadata | ☑️ | ☑️ | -| EBU Broadcast-WAVE metadata | ☑️ | ☑️ | -| Basic iXML/ADM metadata | ☑️ | ☑️ | -| Enhanced iXML metadata support | | | -| ADM `chna` channel metadata | | | -| Broadcast-WAVE Level overview `levl` metadata | | | -| Cue list metadata | ☑️ | | -| Sampler and instrument metadata | | | -| Enhanced Wave file form validation | ☑️ | | +`WaveReader` and `WaveWriter` support: + * A unified interface for standard RIFF and RF64/BW64 64-bit Wave files. + * A unified interface for standard `WaveFormat` and extended `WaveFormatEx` + wave data format specification. + * Multichannel, surround, and ambisonic audio data description including + surround channel maps, ADM AudioTrackFormat, AudioChannelFormatRef and + AudioPackRef data structures. + * Broadcast-Wave metdata extension, including long description, originator + information, SMPTE UMID and coding history. + * Reading and writing of embedded iXML and axml/ADM metadata. + * Reading and writing of timed cues and and timed cue region. + +### Feature Roadmap + +Some features that may be included in the future include: + * Broadcast-Wave `levl` waveform overview data reading and writing. + * Sampler and Instrument mentadata. ## Use Examples -### Examples Directory - Check out the [examples](examples) directory for some practical use cases: * [blits](examples/blits.rs) shows how to use `WaveWriter` to create a new file with BLITS alignment tones. - -### Reading Audio Frames From a File - -```rust - - 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 buffer = format.create_frame_buffer(); - let mut frame_reader = r.audio_frame_reader().unwrap(); - - let read = frame_reader.read_integer_frame(&mut buffer).unwrap(); - - assert_eq!(buffer, [0i32]); - assert_eq!(read, 1); -``` - -### Accessing Channel Descriptions - -```rust - use bwavfile::{WaveReader, ChannelMask}; - - let mut f = WaveReader::open("tests/media/pt_24bit_51.wav").unwrap(); - - let chans = f.channels().unwrap(); - assert_eq!(chans[0].index, 0); - assert_eq!(chans[0].speaker, ChannelMask::FrontLeft); - assert_eq!(chans[3].index, 3); - assert_eq!(chans[3].speaker, ChannelMask::LowFrequency); - assert_eq!(chans[4].speaker, ChannelMask::BackLeft); -``` + * [wave-inter](examples/wave-inter.rs) uses `WaveReader` and `WaveWriter` to + interleave several input Wave files into a single polyphonic Wave file. + * [wave-deinter](examples/wave-deinter.rs) uses `WaveReader` and `WaveWriter` + to de-interleave an input Wave file into several monoarual Wave files. ## Note on Testing diff --git a/src/audio_frame_reader.rs b/src/audio_frame_reader.rs index e9b13ef..0424a61 100644 --- a/src/audio_frame_reader.rs +++ b/src/audio_frame_reader.rs @@ -106,4 +106,8 @@ impl AudioFrameReader { Ok( 0 ) } } + + pub fn read_float_frame(&mut self, buffer:&mut [f32]) -> Result { + todo!() + } } \ No newline at end of file From 75fc40d638c6d02d32925e7ee590e96f303fb1ac Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sat, 2 Jan 2021 15:45:24 -0800 Subject: [PATCH 2/6] Bump version and license year --- Cargo.lock | 2 +- Cargo.toml | 2 +- LICENSE | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bcfe990..02e6365 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,7 +28,7 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] name = "bwavfile" -version = "0.9.2" +version = "1.0.0" dependencies = [ "byteorder", "clap", diff --git a/Cargo.toml b/Cargo.toml index 5c8e107..c8626cb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bwavfile" -version = "0.9.2" +version = "1.0.0" authors = ["Jamie Hardt "] edition = "2018" license = "MIT" diff --git a/LICENSE b/LICENSE index b39b2f5..82033a6 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 Jamie Hardt +Copyright (c) 2021 Jamie Hardt Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 80be74c8fbadbfade92ca7a63db427a34e045f0b Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sat, 2 Jan 2021 16:04:44 -0800 Subject: [PATCH 3/6] Features --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9b11bc0..1c4c4cf 100644 --- a/README.md +++ b/README.md @@ -13,11 +13,15 @@ reading and creating new audio files respectively. `WaveReader` and `WaveWriter` support: * A unified interface for standard RIFF and RF64/BW64 64-bit Wave files. + * When using `WaveWriter`, wave files are transparently upgraded from RIFF + to RF64 when required. + * Unpacked reading and writing of Integer PCM and IEEE float audio data + formats. * A unified interface for standard `WaveFormat` and extended `WaveFormatEx` wave data format specification. * Multichannel, surround, and ambisonic audio data description including - surround channel maps, ADM AudioTrackFormat, AudioChannelFormatRef and - AudioPackRef data structures. + surround channel maps, ADM `AudioTrackFormat`, `AudioChannelFormatRef` and + `AudioPackRef` data structures. * Broadcast-Wave metdata extension, including long description, originator information, SMPTE UMID and coding history. * Reading and writing of embedded iXML and axml/ADM metadata. From 1a169da48f6b83c4b321c5ca4ddf9be208d6e2cc Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sun, 3 Jan 2021 13:27:35 -0800 Subject: [PATCH 4/6] removed inapplicable code --- src/lib.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 2f2103f..a9a858a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -35,12 +35,6 @@ Apps we test against: [github]: https://github.com/iluvcapra/bwavfile */ -// #![feature(external_doc)] - -// #[doc(include="../README.md")] -// #[cfg(doctest)] -// pub struct ReadmeDoctests; - extern crate encoding; extern crate byteorder; extern crate uuid; From 6375567af133a3bfa5986d6e2ad9cbb2dd6753b5 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sun, 3 Jan 2021 18:41:37 -0800 Subject: [PATCH 5/6] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 1c4c4cf..8bb77ca 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,6 @@ Some features that may be included in the future include: ## Use Examples -Check out the [examples](examples) directory for some practical use cases: - * [blits](examples/blits.rs) shows how to use `WaveWriter` to create a new file with BLITS alignment tones. * [wave-inter](examples/wave-inter.rs) uses `WaveReader` and `WaveWriter` to From d17c6badfa32f619c7462804a2f2941a5cede62e Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Wed, 23 Jun 2021 10:18:44 -0700 Subject: [PATCH 6/6] Removed unused import --- examples/wave-deinter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/wave-deinter.rs b/examples/wave-deinter.rs index 48350df..efb241b 100644 --- a/examples/wave-deinter.rs +++ b/examples/wave-deinter.rs @@ -8,7 +8,7 @@ use std::io; use std::path::Path; extern crate bwavfile; -use bwavfile::{Error,WaveReader, WaveWriter, ChannelDescriptor, ChannelMask, WaveFmt, AudioFrameWriter}; +use bwavfile::{Error,WaveReader, WaveWriter, ChannelDescriptor, ChannelMask, WaveFmt}; #[macro_use] extern crate clap;