| 34 | } |
| 35 | |
| 36 | std::vector<std::filesystem::path> sorted_wav_files(const std::filesystem::path & input_dir) { |
| 37 | if (!std::filesystem::is_directory(input_dir)) { |
| 38 | throw std::runtime_error("audio utility input directory is missing: " + input_dir.string()); |
| 39 | } |
| 40 | std::vector<std::filesystem::path> files; |
| 41 | for (const auto & entry : std::filesystem::directory_iterator(input_dir)) { |
| 42 | if (entry.is_regular_file() && is_wav_file(entry.path())) { |
| 43 | files.push_back(entry.path()); |
| 44 | } |
| 45 | } |
| 46 | std::sort(files.begin(), files.end()); |
| 47 | if (files.empty()) { |
| 48 | throw std::runtime_error("audio utility input directory contains no WAV files: " + input_dir.string()); |
| 49 | } |
| 50 | return files; |
| 51 | } |
| 52 | |
| 53 | std::filesystem::path output_path_for( |
| 54 | const std::filesystem::path & input_file, |
no test coverage detected