| 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 | |
| 394 | bool 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 | |
| 401 | int64_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 | } |
no test coverage detected