lhotse-speech / lhotse

Tools for handling speech data in machine learning projects.
https://lhotse.readthedocs.io/en/latest/
Apache License 2.0
956 stars 219 forks source link

Fix backend to None while ffmpeg is unavailable. #1392

Closed pengzhendong closed 1 month ago

pengzhendong commented 2 months ago

Before:

Screenshot 2024-09-14 at 18 34 15

After:

Screenshot 2024-09-14 at 18 35 08
pzelasko commented 2 months ago

Wait, that's weird. This code is guarded by if torchaudio_ffmpeg_backend_available(): so it shouldn't have entered this branch at all. Perhaps you could move this extra logic inside torchaudio_ffmpeg_backend_available instead? Looks like the check there may be insufficient.

pengzhendong commented 2 months ago

If it is moved to torchaudio_ffmpeg_backend_available, Lhotse will utilize torchaudio.StreamReader to read the audio instead of torchaudio.info.

ImportError: Failed to initialize the FFmpeg extension. Tried versions: ['6', '5', '4', '']. Enabling DEBUG logging will provide more details about the error.

pzelasko commented 1 month ago

I'm still not quite sure what's going on but your change seems unlikely to break anything and the backward compatibility tests are passing. LGTM, thanks!