]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
examples : fix VAD min silence argument parsing (#3963)
authorIgor Koshenskii <redacted>
Mon, 3 Aug 2026 06:12:43 +0000 (09:12 +0300)
committerGitHub <redacted>
Mon, 3 Aug 2026 06:12:43 +0000 (08:12 +0200)
Fix --vad-min-silence-duration-ms (-vsd) parsing in whisper-vad-speech-segments.

The option was incorrectly assigned to vad_min_speech_duration_ms instead of vad_min_silence_duration_ms. As a result, the requested silence duration was ignored and the minimum speech duration was overwritten.

examples/vad-speech-segments/speech.cpp

index e929e58e9606461432b2fd6b529d5a76327c5af8..469a30c304fd97ff20ffc97856ea1487c5827f27 100644 (file)
@@ -66,7 +66,7 @@ static bool vad_params_parse(int argc, char ** argv, cli_params & params) {
         else if (arg == "-vm"   || arg == "--vad-model")                   { params.vad_model                   = ARGV_NEXT; }
         else if (arg == "-vt"   || arg == "--vad-threshold")               { params.vad_threshold               = std::stof(ARGV_NEXT); }
         else if (arg == "-vspd" || arg == "--vad-min-speech-duration-ms")  { params.vad_min_speech_duration_ms  = std::stoi(ARGV_NEXT); }
-        else if (arg == "-vsd"  || arg == "--vad-min-silence-duration-ms") { params.vad_min_speech_duration_ms  = std::stoi(ARGV_NEXT); }
+        else if (arg == "-vsd"  || arg == "--vad-min-silence-duration-ms") { params.vad_min_silence_duration_ms = std::stoi(ARGV_NEXT); }
         else if (arg == "-vmsd" || arg == "--vad-max-speech-duration-s")   { params.vad_max_speech_duration_s   = std::stof(ARGV_NEXT); }
         else if (arg == "-vp"   || arg == "--vad-speech-pad-ms")           { params.vad_speech_pad_ms           = std::stoi(ARGV_NEXT); }
         else if (arg == "-vo"   || arg == "--vad-samples-overlap")         { params.vad_samples_overlap         = std::stof(ARGV_NEXT); }