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

Possible without reading the entire file? #5

Open
milesegan opened this issue Aug 9, 2023 · 2 comments
Open

Possible without reading the entire file? #5

milesegan opened this issue Aug 9, 2023 · 2 comments

Comments

@milesegan
Copy link

milesegan commented Aug 9, 2023

Thanks for writing this. It looks very handy. I'm thinking about using this in an app that manages a lot of files. It looks to me like this reads the entire contents of the mp3 right?

final bytes = file.readAsBytesSync();

If so, is it possible to just read the header of the file to get this information?

@amugofjava
Copy link
Owner

Hi @milesegan,

Yes, it does load the entire file. The thinking behind that is, at some point, when I add support for VBR MP3 files I'll need to sample most or all of the file to calculate the duration. For non VBR files, this could be improved upon and only read a portion of the file. I'll look in to that.

@milesegan
Copy link
Author

That's a good point I hadn't considered the VBR case. Thanks again for the library!

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

2 participants