diff --git a/Cargo.lock b/Cargo.lock index 52e891f..3cc5346 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -172,9 +172,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.8.1" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" +checksum = "e6012d540c5baa3589337a98ce73408de9b5a25ec9fc2c6fd6be8f0d39e0ca5a" dependencies = [ "autocfg", "hashbrown", @@ -292,15 +292,15 @@ checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" [[package]] name = "os_str_bytes" -version = "6.0.1" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "029d8d0b2f198229de29dca79676f2738ff952edf3fde542eb8bf94d8c21b435" +checksum = "21326818e99cfe6ce1e524c2a805c189a99b5ae555a35d19f9a284b427d86afa" [[package]] name = "parking_lot" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", "parking_lot_core", @@ -462,9 +462,9 @@ dependencies = [ [[package]] name = "rustpotter" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c32d113d8cae5a9d02291fddaf0c2a11d90c7b003e13566c8e000217f9ce655" +checksum = "73ac37f4a112727073bdc8e51c66bd3a25e208830bd1f55b60a92fa269b03563" dependencies = [ "hound", "log", diff --git a/Cargo.toml b/Cargo.toml index a4af72d..074b0e5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ description = "CLI for Rustpotter, a free and open source wake word spotter forg # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -rustpotter = { version = "0.10.0", features = ["vad"] } +rustpotter = { version = "0.10.1", features = ["vad"] } log = "0.4.6" pv_recorder = "1.0.2" ctrlc = "3.2.2" diff --git a/src/cli/build_model.rs b/src/cli/build_model.rs index 8585ec5..31bbaba 100644 --- a/src/cli/build_model.rs +++ b/src/cli/build_model.rs @@ -4,6 +4,8 @@ use clap::Args; use hound::WavReader; use rustpotter::WakewordDetectorBuilder; +use crate::utils::enable_rustpotter_log; + #[derive(Args, Debug)] /// Build model file from samples #[clap()] @@ -23,6 +25,9 @@ pub struct BuildModelCommand { #[clap(short = 'a', long)] /// Averaged threshold to configure in the generated model, overwrites the detector averaged threshold averaged_threshold: Option, + #[clap(long)] + /// Enables rustpotter debug log + debug: bool, } pub fn build(command: BuildModelCommand) -> Result<(), String> { println!("Start building {}!", command.model_path); @@ -34,6 +39,9 @@ pub fn build(command: BuildModelCommand) -> Result<(), String> { .spec(); println!("{}: {:?}", path, wav_spec); } + if command.debug { + enable_rustpotter_log(); + } let mut word_detector = WakewordDetectorBuilder::new().build(); word_detector.add_wakeword( &command.model_name,