MCPcopy Create free account
hub / github.com/modelscope/FunASR / iter_audio_files

Function iter_audio_files

examples/migration/benchmark_funasr.py:83–89  ·  view source on GitHub ↗
(path: Path, extensions: List[str], recursive: bool)

Source from the content-addressed store, hash-verified

81
82
83def 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
92def audio_duration_seconds(path: Path) -> Optional[float]:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…