Skip to content

Commit

Permalink
v0.10.1: update rustpotter
Browse files Browse the repository at this point in the history
  • Loading branch information
GiviMAD committed May 31, 2022
1 parent e29eb18 commit d45642d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 8 additions & 0 deletions src/cli/build_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()]
Expand All @@ -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<f32>,
#[clap(long)]
/// Enables rustpotter debug log
debug: bool,
}
pub fn build(command: BuildModelCommand) -> Result<(), String> {
println!("Start building {}!", command.model_path);
Expand All @@ -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,
Expand Down

0 comments on commit d45642d

Please sign in to comment.