(path: Path, extensions: List[str], recursive: bool)
| 81 | |
| 82 | |
| 83 | def iter_audio_files(path: Path, extensions: List[str], recursive: bool) -> List[Path]: |
| 84 | if path.is_file(): |
| 85 | return [path] |
| 86 | if not path.exists(): |
| 87 | raise FileNotFoundError(f"Input path does not exist: {path}") |
| 88 | walker = path.rglob("*") if recursive else path.iterdir() |
| 89 | return sorted(p for p in walker if p.is_file() and p.suffix.lower() in extensions) |
| 90 | |
| 91 | |
| 92 | def audio_duration_seconds(path: Path) -> Optional[float]: |
no outgoing calls
no test coverage detected
searching dependent graphs…