Structuring Readme

This commit is contained in:
Jamie Hardt
2021-01-02 15:44:05 -08:00
parent b160284e21
commit 2780bfb31b
2 changed files with 29 additions and 55 deletions

View File

@@ -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) [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/iluvcapra/bwavfile/Rust)](https://github.com/iluvcapra/bwavfile/actions?query=workflow%3ARust)
# bwavfile # 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| `WaveReader` and `WaveWriter` support:
|---------------------------------------|:---:|:-----:| * A unified interface for standard RIFF and RF64/BW64 64-bit Wave files.
| Standard .wav files | ☑️ | ☑️ | * A unified interface for standard `WaveFormat` and extended `WaveFormatEx`
| Transparent promotion to RF64/BW64 | ☑️ | ☑️ | wave data format specification.
| Unified interface for regular and extended Wave format | ☑️ | ☑️ | * Multichannel, surround, and ambisonic audio data description including
| Channel/speaker map metadata | ☑️ | ☑️ | surround channel maps, ADM AudioTrackFormat, AudioChannelFormatRef and
| Ambisonic B-format metadata | ☑️ | ☑️ | AudioPackRef data structures.
| EBU Broadcast-WAVE metadata | ☑️ | ☑️ | * Broadcast-Wave metdata extension, including long description, originator
| Basic iXML/ADM metadata | ☑️ | ☑️ | information, SMPTE UMID and coding history.
| Enhanced iXML metadata support | | | * Reading and writing of embedded iXML and axml/ADM metadata.
| ADM `chna` channel metadata | | | * Reading and writing of timed cues and and timed cue region.
| Broadcast-WAVE Level overview `levl` metadata | | |
| Cue list metadata | ☑️ | | ### Feature Roadmap
| Sampler and instrument metadata | | |
| Enhanced Wave file form validation | ☑️ | | 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 ## Use Examples
### Examples Directory
Check out the [examples](examples) directory for some practical use cases: Check out the [examples](examples) directory for some practical use cases:
* [blits](examples/blits.rs) shows how to use `WaveWriter` to create a new * [blits](examples/blits.rs) shows how to use `WaveWriter` to create a new
file with BLITS alignment tones. file with BLITS alignment tones.
* [wave-inter](examples/wave-inter.rs) uses `WaveReader` and `WaveWriter` to
### Reading Audio Frames From a File interleave several input Wave files into a single polyphonic Wave file.
* [wave-deinter](examples/wave-deinter.rs) uses `WaveReader` and `WaveWriter`
```rust to de-interleave an input Wave file into several monoarual Wave files.
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);
```
## Note on Testing ## Note on Testing

View File

@@ -106,4 +106,8 @@ impl<R: Read + Seek> AudioFrameReader<R> {
Ok( 0 ) Ok( 0 )
} }
} }
pub fn read_float_frame(&mut self, buffer:&mut [f32]) -> Result<u64, Error> {
todo!()
}
} }