mirror of
https://github.com/iluvcapra/bwavfile.git
synced 2026-01-02 09:50:44 +00:00
Examples interface
Notes on Bext
This commit is contained in:
@@ -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 format = WaveFmt::new_pcm_multichannel(sample_rate, bits_per_sample as u16, 0b111111);
|
||||||
|
|
||||||
let file = WaveWriter::create(file_name, format)?;
|
let file = WaveWriter::create(file_name, format)?;
|
||||||
|
|
||||||
let mut fw = file.audio_frame_writer()?;
|
let mut fw = file.audio_frame_writer()?;
|
||||||
for frame in frames {
|
for frame in frames {
|
||||||
let buf = vec![frame.0, frame.1, frame.2, frame.3, frame.4, frame.5];
|
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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[macro_use]
|
||||||
|
extern crate clap;
|
||||||
use clap::{Arg, App};
|
use clap::{Arg, App};
|
||||||
|
|
||||||
fn main() -> io::Result<()> {
|
fn main() -> io::Result<()> {
|
||||||
|
|
||||||
let matches = App::new("blits")
|
let matches = App::new("blits")
|
||||||
.version("0.1")
|
.version(crate_version!())
|
||||||
.author("Jamie Hardt")
|
.author(crate_authors!())
|
||||||
.about("Generate a BLITS 5.1 alignment tone.")
|
.about("Generate a BLITS 5.1 alignment tone.")
|
||||||
.arg(Arg::with_name("sample_rate")
|
.arg(Arg::with_name("sample_rate")
|
||||||
.long("sample-rate")
|
.long("sample-rate")
|
||||||
|
|||||||
@@ -4,16 +4,17 @@
|
|||||||
//! This program demonstrats combining several wave files into a single
|
//! This program demonstrats combining several wave files into a single
|
||||||
//! polyphonic wave file.
|
//! polyphonic wave file.
|
||||||
|
|
||||||
extern crate clap;
|
|
||||||
|
|
||||||
use std::io;
|
use std::io;
|
||||||
|
|
||||||
|
#[macro_use]
|
||||||
|
extern crate clap;
|
||||||
use clap::{Arg, App};
|
use clap::{Arg, App};
|
||||||
|
|
||||||
fn main() -> io::Result<()> {
|
fn main() -> io::Result<()> {
|
||||||
|
|
||||||
let matches = App::new("wave-deinter")
|
let matches = App::new("wave-deinter")
|
||||||
.version("0.1")
|
.version(crate_version!())
|
||||||
.author("Jamie Hardt")
|
.author(crate_authors!())
|
||||||
.about("Extract each channel of a polyphonic wave file as a new monoaural wave file.")
|
.about("Extract each channel of a polyphonic wave file as a new monoaural wave file.")
|
||||||
.arg(Arg::with_name("OUTPUT")
|
.arg(Arg::with_name("OUTPUT")
|
||||||
.long("output")
|
.long("output")
|
||||||
|
|||||||
@@ -4,15 +4,16 @@
|
|||||||
//! This program demonstrates combining several wave files into a single
|
//! This program demonstrates combining several wave files into a single
|
||||||
//! polyphonic wave file.
|
//! polyphonic wave file.
|
||||||
|
|
||||||
extern crate clap;
|
|
||||||
|
|
||||||
use std::io;
|
use std::io;
|
||||||
|
|
||||||
|
#[macro_use]
|
||||||
|
extern crate clap;
|
||||||
use clap::{Arg, App};
|
use clap::{Arg, App};
|
||||||
|
|
||||||
fn main() -> io::Result<()> {
|
fn main() -> io::Result<()> {
|
||||||
let matches = App::new("wave-inter")
|
let matches = App::new("wave-inter")
|
||||||
.version("0.1")
|
.version(crate_version!())
|
||||||
.author("Jamie Hardt")
|
.author(crate_authors!())
|
||||||
.about("Combine several wave files into a single polyphonic wave file.")
|
.about("Combine several wave files into a single polyphonic wave file.")
|
||||||
.arg(Arg::with_name("OUTPUT")
|
.arg(Arg::with_name("OUTPUT")
|
||||||
.long("output")
|
.long("output")
|
||||||
|
|||||||
@@ -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
|
/// - [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"
|
/// <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)]
|
#[derive(Debug)]
|
||||||
pub struct Bext {
|
pub struct Bext {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user