Use FFmpeg-based I/O as fallback in sox_io backend (#2419)
Summary: This commit add fallback mechanism to `info` and `load` functions of sox_io backend. If torchaudio is compiled to use FFmpeg, and runtime dependencies are properly loaded, in case `info` and `load` fail, it fallback to FFmpeg-based implementation. BC-breaking changes: - FFmpeg does not report the number of frames for MP3, this is because MP3 does not store the information of the number of frames. It can be estimated from the audio duration and sample rate, but it might be inaccurate, so we keep it 0. Depends on - https://github.com/pytorch/audio/issues/2416 - https://github.com/pytorch/audio/issues/2417 - https://github.com/pytorch/audio/issues/2418 - https://github.com/pytorch/audio/issues/2423 - https://github.com/pytorch/audio/issues/2427 Pull Request resolved: https://github.com/pytorch/audio/pull/2419 Reviewed By: carolineechen Differential Revision: D36740306 Pulled By: mthrok fbshipit-source-id: 9e2ad095b8b39e41404970de0d8d9b5aaa856c97
Showing
torchaudio/io/_compat.py
0 → 100644
Please register or sign in to comment