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

Reduce memory usage in load_audio #1920

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ryanheise
Copy link
Contributor

Removes the call to flatten() which creates an in-memory copy of the array, and which seems to be unnecessary since the shape is already flat. Since the array being copied here is the entire uncompressed audio file in raw samples, avoiding the copy significantly reduces peak memory usage and can help very long audio files to fit in systems with constrained memory. Not a general solution to long files (though that would be nice), but just pushes back the memory limits slightly further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant