Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate torchaudio's 2.0 ffmpeg backend for audio loading + add some optimizations #1043

Merged
merged 8 commits into from
Apr 27, 2023

Conversation

pzelasko
Copy link
Collaborator

@pzelasko pzelasko commented Apr 26, 2023

At least for in-memory data with file-like objects, I found ffmpeg FLAC decoder to be twice as fast as that of libsoundfile.

Note: enabling this feature with pytorch/torchaudio 2.0 requires setting of the following environment variable: TORCHAUDIO_USE_BACKEND_DISPATCHER=1, and this shouldn't be necessary anymore starting with version 2.1

@pzelasko pzelasko added this to the v1.14 milestone Apr 26, 2023
@pzelasko
Copy link
Collaborator Author

Turns out when we enable ffmpeg backend it seems to slightly modify the audio when saving to WAVE (by up to 2/int16max), so I modified some tests to work around it and filed an issue in torchaudio pytorch/audio#3281

@pzelasko pzelasko merged commit 1487279 into master Apr 27, 2023
@pzelasko pzelasko deleted the feature/torchaudio-ffmpeg-backend branch April 27, 2023 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant