aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-06-20 07:42:06 +0800
committer魏曹先生 <1992414357@qq.com>2026-06-20 07:42:06 +0800
commit90595bbed2b0fdfda45980dc7ebff8c4eb11dcbd (patch)
tree11fc0769346444c64e163db0d8a611225200ec3e
parent9b896d697eb582dedd2533f6d2054f062c8381a0 (diff)
feat: add instant mode for near-real-time output0.1.0
-rw-r--r--help.txt2
-rw-r--r--src/args.rs5
-rw-r--r--src/main.rs10
3 files changed, 17 insertions, 0 deletions
diff --git a/help.txt b/help.txt
index 013c782..d4aff6e 100644
--- a/help.txt
+++ b/help.txt
@@ -16,6 +16,8 @@ Options
-L, --list-devices List microphones and exit.
--list-models List Whisper models and exit.
--download-model=<name> Download a model and exit.
+ --instant Aggressive mode — shorter segments for
+ near-real-time output. Speak slowly.
-V, --verbose Show debug output.
-h, --help Show this help.
diff --git a/src/args.rs b/src/args.rs
index c27ff78..679d8e1 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -23,6 +23,11 @@ pub struct DMVOPArguments {
// Show help
#[arg(long = "help", short = 'h')]
pub help: bool,
+
+ // Instant mode — aggressive VAD for near-real-time output
+ #[arg(long = "instant")]
+ pub instant: bool,
+
// Verbose output (show debug messages)
#[arg(long = "verbose", short = 'V')]
pub verbose: bool,
diff --git a/src/main.rs b/src/main.rs
index 15f23f7..fabf16c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -116,6 +116,16 @@ async fn main() {
let mut builder = EngineBuilder::new().app_name("dmvop").model(model);
+ if args.instant {
+ debug_log!("[dmvop] Instant mode: aggressive VAD for near-real-time output");
+ builder = builder
+ .vad_voiced_onset_ms(40)
+ .vad_whisper_onset_ms(60)
+ .segment_max_duration_ms(800)
+ .segment_word_break_grace_ms(100)
+ .word_break_segmentation_enabled(true);
+ }
+
if let Some(ref lang) = args.lang {
debug_log!("[dmvop] Language hint: {}", lang);
builder = builder.language(lang.as_str());