Spaces:
Sleeping
Sleeping
Update js/app.py
Browse files166 unmodified lines167168169170171172173174166 unmodified linesDecodes any audio format directly to memory using FFmpeg and loads it into a torch Tensor,avoiding intermediate disk I/O."""# Fast path: direct C++ loading for WAV and FLAC to bypass FFmpeg subprocess invocationif input_path.suffix.lower() in [".wav", ".flac"]:try:wav, sr = torchaudio.load(str(input_path))if sr != target_sr:166 unmodified lines167168169170171172173174166 unmodified linesDecodes any audio format directly to memory using FFmpeg and loads it into a torch Tensor,avoiding intermediate disk I/O."""# Fast path: direct C++ loading for WAV, FLAC, MP3, and M4A to bypass FFmpeg subprocess invocationif input_path.suffix.lower() in [".wav", ".flac", ".mp3", ".m4a"]:try:wav, sr = torchaudio.load(str(input_path))if sr != target_sr:
js/app.py+2-2