Make buffer size configurable in ffmpeg file object operations and set size in backend (#2810)
Summary: Partly addresses https://github.com/pytorch/audio/issues/2686 and https://github.com/pytorch/audio/issues/2356. Currently, when the buffer used for file object decoding is insufficiently large, `torchaudio.load` returns a shorter waveform than expected. To deal with this, the user is expected to increase the buffer size via `torchaudio.utils.sox_utils.get_buffer_size`, but this does not influence the buffer used by the FFMpeg fallback. To fix this, this PR introduces changes that apply the buffer size set for the SoX backend to FFMpeg. As a follow-up, we should see whether it's possible to programmatically detect that the buffer's too small and flag it to the user. Pull Request resolved: https://github.com/pytorch/audio/pull/2810 Reviewed By: mthrok Differential Revision: D40906978 Pulled By: hwangjeff fbshipit-source-id: 256fe1da8b21610b05bea9a0e043f484f9ea2e76
Showing
Please register or sign in to comment