MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / vad_chunk_options_from_cli

Function vad_chunk_options_from_cli

app/cli/main.cpp:384–403  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

382 }
383 std::cout << "\n";
384 std::cout << "configs=" << inspection.discovered_configs.size() << "\n";
385 for (const auto & config : inspection.discovered_configs) {
386 std::cout << "config=" << config.id << ":" << config.path.string() << "\n";
387 }
388 std::cout << "weights=" << inspection.discovered_weights.size() << "\n";
389 for (const auto & weight : inspection.discovered_weights) {
390 std::cout << "weight=" << weight.id << ":" << weight.path.string() << "\n";
391 }
392}
393
394bool has_vad_chunk_option(int argc, char ** argv) {
395 return minitts::cli::optional_path_arg(argc, argv, "--vad-chunks-out").has_value() ||
396 minitts::cli::find_arg(argc, argv, "--vad-chunk-max-seconds").has_value() ||
397 minitts::cli::find_arg(argc, argv, "--vad-chunk-merge-gap-seconds").has_value() ||
398 minitts::cli::find_arg(argc, argv, "--vad-chunk-padding-seconds").has_value();
399}
400
401int64_t seconds_to_samples(float seconds, int sample_rate, const std::string & name) {
402 if (seconds < 0.0F) {
403 throw std::runtime_error(name + " must be non-negative");
404 }
405 return static_cast<int64_t>(std::llround(static_cast<double>(seconds) * sample_rate));
406}

Callers 1

mainFunction · 0.85

Calls 2

parse_optional_float_argFunction · 0.85
seconds_to_samplesFunction · 0.70

Tested by

no test coverage detected