|
4 | 4 | [](https://github.com/iluvcapra/bwavfile/actions?query=workflow%3ARust)
|
5 | 5 |
|
6 | 6 | # bwavfile
|
7 |
| -Rust Wave File Reader/Writer with Broadcast-WAV, MBWF and RF64 Support |
| 7 | +Wave File Reader/Writer library in Rust, with Broadcast-WAV, MBWF and RF64 Support |
8 | 8 |
|
9 |
| -### Features |
| 9 | +## Features |
10 | 10 |
|
11 |
| -This is currently a work-in-progress! However many features presently work: |
| 11 | +__bwavfile__ provides a reader `WaveReader` and writer type `WaveWriter` for |
| 12 | +reading and creating new audio files respectively. |
12 | 13 |
|
13 |
| -| Feature |Read |Write| |
14 |
| -|---------------------------------------|:---:|:-----:| |
15 |
| -| Standard .wav files | ☑️ | ☑️ | |
16 |
| -| Transparent promotion to RF64/BW64 | ☑️ | ☑️ | |
17 |
| -| Unified interface for regular and extended Wave format | ☑️ | ☑️ | |
18 |
| -| Channel/speaker map metadata | ☑️ | ☑️ | |
19 |
| -| Ambisonic B-format metadata | ☑️ | ☑️ | |
20 |
| -| EBU Broadcast-WAVE metadata | ☑️ | ☑️ | |
21 |
| -| Basic iXML/ADM metadata | ☑️ | ☑️ | |
22 |
| -| Enhanced iXML metadata support | | | |
23 |
| -| ADM `chna` channel metadata | | | |
24 |
| -| Broadcast-WAVE Level overview `levl` metadata | | | |
25 |
| -| Cue list metadata | ☑️ | | |
26 |
| -| Sampler and instrument metadata | | | |
27 |
| -| Enhanced Wave file form validation | ☑️ | | |
| 14 | +`WaveReader` and `WaveWriter` support: |
| 15 | + * A unified interface for standard RIFF and RF64/BW64 64-bit Wave files. |
| 16 | + * When using `WaveWriter`, wave files are transparently upgraded from RIFF |
| 17 | + to RF64 when required. |
| 18 | + * Unpacked reading and writing of Integer PCM and IEEE float audio data |
| 19 | + formats. |
| 20 | + * A unified interface for standard `WaveFormat` and extended `WaveFormatEx` |
| 21 | + wave data format specification. |
| 22 | + * Multichannel, surround, and ambisonic audio data description including |
| 23 | + surround channel maps, ADM `AudioTrackFormat`, `AudioChannelFormatRef` and |
| 24 | + `AudioPackRef` data structures. |
| 25 | + * Broadcast-Wave metdata extension, including long description, originator |
| 26 | + information, SMPTE UMID and coding history. |
| 27 | + * Reading and writing of embedded iXML and axml/ADM metadata. |
| 28 | + * Reading and writing of timed cues and and timed cue region. |
28 | 29 |
|
| 30 | +### Feature Roadmap |
29 | 31 |
|
30 |
| -## Use Examples |
| 32 | +Some features that may be included in the future include: |
| 33 | + * Broadcast-Wave `levl` waveform overview data reading and writing. |
| 34 | + * Sampler and Instrument mentadata. |
31 | 35 |
|
32 |
| -### Examples Directory |
33 | 36 |
|
34 |
| -Check out the [examples](examples) directory for some practical use cases: |
| 37 | +## Use Examples |
35 | 38 |
|
36 | 39 | * [blits](examples/blits.rs) shows how to use `WaveWriter` to create a new
|
37 | 40 | file with BLITS alignment tones.
|
38 |
| - |
39 |
| -### Reading Audio Frames From a File |
40 |
| - |
41 |
| -```rust |
42 |
| - |
43 |
| - use bwavfile::WaveReader; |
44 |
| - let mut r = WaveReader::open("tests/media/ff_silence.wav").unwrap(); |
45 |
| - |
46 |
| - let format = r.format().unwrap(); |
47 |
| - assert_eq!(format.sample_rate, 44100); |
48 |
| - assert_eq!(format.channel_count, 1); |
49 |
| - |
50 |
| - let mut buffer = format.create_frame_buffer(); |
51 |
| - let mut frame_reader = r.audio_frame_reader().unwrap(); |
52 |
| - |
53 |
| - let read = frame_reader.read_integer_frame(&mut buffer).unwrap(); |
54 |
| - |
55 |
| - assert_eq!(buffer, [0i32]); |
56 |
| - assert_eq!(read, 1); |
57 |
| -``` |
58 |
| - |
59 |
| -### Accessing Channel Descriptions |
60 |
| - |
61 |
| -```rust |
62 |
| - use bwavfile::{WaveReader, ChannelMask}; |
63 |
| - |
64 |
| - let mut f = WaveReader::open("tests/media/pt_24bit_51.wav").unwrap(); |
65 |
| - |
66 |
| - let chans = f.channels().unwrap(); |
67 |
| - assert_eq!(chans[0].index, 0); |
68 |
| - assert_eq!(chans[0].speaker, ChannelMask::FrontLeft); |
69 |
| - assert_eq!(chans[3].index, 3); |
70 |
| - assert_eq!(chans[3].speaker, ChannelMask::LowFrequency); |
71 |
| - assert_eq!(chans[4].speaker, ChannelMask::BackLeft); |
72 |
| -``` |
| 41 | + * [wave-inter](examples/wave-inter.rs) uses `WaveReader` and `WaveWriter` to |
| 42 | + interleave several input Wave files into a single polyphonic Wave file. |
| 43 | + * [wave-deinter](examples/wave-deinter.rs) uses `WaveReader` and `WaveWriter` |
| 44 | + to de-interleave an input Wave file into several monoarual Wave files. |
73 | 45 |
|
74 | 46 | ## Note on Testing
|
75 | 47 |
|
|
0 commit comments