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

Is partial loading possible? #38

Closed
Athospd opened this issue Jan 26, 2021 · 2 comments
Closed

Is partial loading possible? #38

Athospd opened this issue Jan 26, 2021 · 2 comments

Comments

@Athospd
Copy link

Athospd commented Jan 26, 2021

I would like to load just an interval of a given .wav file aiming to avoid bringing the full audio to memory. Is it possible?
When I call .load(filepath) it seems to bring everything at once. Am I right?

Thank you for this awesome lib!

@dedobbin
Copy link

dedobbin commented May 8, 2021

I'm working on a feature that allows this. It still loads all raw data to RAM, but only decodes the part you need. Is that acceptable in your case? You would use it like myAudioFile.load ("path_to_file", numFrames);

I'm still looking into only loading the raw data that is needed, because this current approach doesn't give much benefit over loading a full audio file and resizing it. But that would need a bit more of restructuring.

If you are interested you can find it here:
https://github.com/dedobbin/AudioFile/tree/partial-load

It's still WIP but if there is interest i can make a PR

@adamstark
Copy link
Owner

I took a look at this but eventually decided against it - I explain more in the response to pull request #45, so have a look there for a full explanation :)

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

No branches or pull requests

3 participants