Refactor arg mapping in ffmpeg save function (#3387)
Summary:
The arguments of TorchAudio's save function ("format", "bits_per_sample" and "encoding")
are not one-to-one mapping to the arguments of FFmpeg encoding.
For example, to use vorbis codec, FFmpeg expects "ogg" container/extension with "vorbis"
encoder. It does not recognize "vorbis" extension like TorchAudio (libsox) does.
This commit refactors the logic to parse/map the arguments.
As a result it now properly works with vorbis and mp3 extension.
Pull Request resolved: https://github.com/pytorch/audio/pull/3387
Reviewed By: hwangjeff
Differential Revision: D46328787
Pulled By: mthrok
fbshipit-source-id: 36f993952a062bfec58a8b51be6aa86297571f90
Showing
Please register or sign in to comment