Skip to content

Commit

Permalink
allow record on partial detections
Browse files Browse the repository at this point in the history
  • Loading branch information
GiviMAD committed Aug 20, 2023
1 parent 70198a0 commit 81cab06
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "rustpotter-cli"
version = "3.0.0-beta.2"
version = "3.0.0-beta.4"
edition = "2021"
license = "Apache-2.0"
description = "CLI for Rustpotter, an open source wakeword spotter forged in rust."
authors = ["Miguel Álvarez Díez <[email protected]>"]
repository = "https://github.com/GiviMAD/rustpotter"
exclude = ["tools/**",".github",".gitignore"]
[dependencies]
rustpotter = { version = "3.0.0-beta.2", features = ["debug", "audio"] }
rustpotter = { version = "3.0.0-beta.4", features = ["debug", "audio", "record"] }
ctrlc = "3.2.2"
clap = { version = "4.1.6", features = ["derive"] }
hound = "3.4.0"
Expand Down
4 changes: 4 additions & 0 deletions src/cli/spot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ pub struct SpotCommand {
#[clap(long)]
/// Log rms level ref, gain applied per frame and frame rms level.
debug_gain: bool,
#[clap(short, long)]
/// Path to create records, one on the first partial detection and another each one that scores better.
record_path: Option<String>,
}

pub fn spot(command: SpotCommand) -> Result<(), String> {
Expand Down Expand Up @@ -126,6 +129,7 @@ pub fn spot(command: SpotCommand) -> Result<(), String> {
config.detector.min_scores = command.min_scores;
config.detector.score_mode = command.score_mode.into();
config.detector.score_ref = command.score_ref;
config.detector.record_path = command.record_path;
config.filters.gain_normalizer.enabled = command.gain_normalizer;
config.filters.gain_normalizer.gain_ref = command.gain_ref;
config.filters.gain_normalizer.min_gain = command.min_gain;
Expand Down
4 changes: 4 additions & 0 deletions src/cli/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ pub struct TestCommand {
#[clap(long)]
/// Log rms level ref, gain applied per frame and frame rms level.
debug_gain: bool,
#[clap(short, long)]
/// Path to create records, one on the first partial detection and another each one that scores better.
record_path: Option<String>,
}
pub fn test(command: TestCommand) -> Result<(), String> {
println!(
Expand All @@ -77,6 +80,7 @@ pub fn test(command: TestCommand) -> Result<(), String> {
config.detector.min_scores = command.min_scores;
config.detector.score_mode = command.score_mode.into();
config.detector.score_ref = command.score_ref;
config.detector.record_path = command.record_path;
config.filters.gain_normalizer.enabled = command.gain_normalizer;
config.filters.gain_normalizer.gain_ref = command.gain_ref;
config.filters.gain_normalizer.min_gain = command.min_gain;
Expand Down

0 comments on commit 81cab06

Please sign in to comment.