From 8d55b126ae39c463416c2e3f5794cb64338e2ed4 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sat, 2 Jan 2021 13:38:56 -0800 Subject: [PATCH] Examples interface Notes on Bext --- examples/blits.rs | 7 +++++-- examples/wave-deinter.rs | 9 +++++---- examples/wave-inter.rs | 9 +++++---- src/bext.rs | 4 ++++ 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/examples/blits.rs b/examples/blits.rs index 8fb8d60..e9ab4a9 100644 --- a/examples/blits.rs +++ b/examples/blits.rs @@ -206,6 +206,7 @@ fn create_blits_file(file_name: &str, sample_rate : u32, bits_per_sample : u16) let format = WaveFmt::new_pcm_multichannel(sample_rate, bits_per_sample as u16, 0b111111); let file = WaveWriter::create(file_name, format)?; + let mut fw = file.audio_frame_writer()?; for frame in frames { let buf = vec![frame.0, frame.1, frame.2, frame.3, frame.4, frame.5]; @@ -216,13 +217,15 @@ fn create_blits_file(file_name: &str, sample_rate : u32, bits_per_sample : u16) Ok(()) } +#[macro_use] +extern crate clap; use clap::{Arg, App}; fn main() -> io::Result<()> { let matches = App::new("blits") - .version("0.1") - .author("Jamie Hardt") + .version(crate_version!()) + .author(crate_authors!()) .about("Generate a BLITS 5.1 alignment tone.") .arg(Arg::with_name("sample_rate") .long("sample-rate") diff --git a/examples/wave-deinter.rs b/examples/wave-deinter.rs index 233cbe1..1d5defa 100644 --- a/examples/wave-deinter.rs +++ b/examples/wave-deinter.rs @@ -4,16 +4,17 @@ //! This program demonstrats combining several wave files into a single //! polyphonic wave file. -extern crate clap; - use std::io; + +#[macro_use] +extern crate clap; use clap::{Arg, App}; fn main() -> io::Result<()> { let matches = App::new("wave-deinter") - .version("0.1") - .author("Jamie Hardt") + .version(crate_version!()) + .author(crate_authors!()) .about("Extract each channel of a polyphonic wave file as a new monoaural wave file.") .arg(Arg::with_name("OUTPUT") .long("output") diff --git a/examples/wave-inter.rs b/examples/wave-inter.rs index 1c3dee5..4a0f598 100644 --- a/examples/wave-inter.rs +++ b/examples/wave-inter.rs @@ -4,15 +4,16 @@ //! This program demonstrates combining several wave files into a single //! polyphonic wave file. -extern crate clap; - use std::io; + +#[macro_use] +extern crate clap; use clap::{Arg, App}; fn main() -> io::Result<()> { let matches = App::new("wave-inter") - .version("0.1") - .author("Jamie Hardt") + .version(crate_version!()) + .author(crate_authors!()) .about("Combine several wave files into a single polyphonic wave file.") .arg(Arg::with_name("OUTPUT") .long("output") diff --git a/src/bext.rs b/src/bext.rs index 5e17a2e..6928878 100644 --- a/src/bext.rs +++ b/src/bext.rs @@ -20,6 +20,10 @@ pub type Decibels = f32; /// - [EBU Tech R099](https://tech.ebu.ch/docs/r/r099.pdf) (October 2011) "‘Unique’ Source Identifier (USID) for use in the /// <OriginatorReference> field of the Broadcast Wave Format" +// Note for me later: +// get env values: https://doc.rust-lang.org/std/macro.option_env.html +// Cargo env values: https://doc.rust-lang.org/cargo/reference/environment-variables.html + #[derive(Debug)] pub struct Bext {