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

Best way to load only what needs to be for the header information only. #294

Closed
joshuapaulanderson opened this issue Dec 10, 2024 · 4 comments
Assignees
Labels

Comments

@joshuapaulanderson
Copy link

The problem

I am wondering the best way to only load what needs to be for performance.
For example we dont want to load a 100 MB file just to modify the header info.
Does ATLDOTNET already do this? If so what is the best way? By using a stream?

Is there a way though code to see where the header info begins and ends?

Environment

  • ATL version (or git revision) that exhibits the issue:
  • Last ATL version that did not exhibit the issue (if applicable):
  • OS/version used to run ATL

Details

If necessary, describe the problem you have been experiencing in more detail.

Don't forget to include ATL.Logging.Log and/or console output

Code To Reproduce Issue [ Good To Have ]

Please remember that with sample code it's easier to reproduce the bug and it's much faster to fix it.

@Zeugma440
Copy link
Owner

Hello and thanks for your feedback.

I have the feeling that you're getting a little too technical too soon. Could you please explain what is the problem you're trying to solve?

@Zeugma440 Zeugma440 self-assigned this Dec 10, 2024
@joshuapaulanderson
Copy link
Author

joshuapaulanderson commented Dec 10, 2024 via email

@Zeugma440
Copy link
Owner

For most audio formats including MP3s, ATL can read metadata from the very first bytes without having to read the entire file.

You can simulate it by asking the library to read an MP3 file you've manually truncated. If the metadata is located at the beginning of the file, ATL will read it as expected. However, if the metadata is located at the end (e.g. APEtag), you'll need the entire file.

If so what is the best way? By using a stream?

There's no "best way" per se; it depends on how your app is designed and how you want to process the data you're acquiring.

As far as I'm concerned, the pseudocode I'd use would be :

BEGIN WHILE LOOP : listen to the data my user is uploading until upload is complete
- Feed the data I have so far to ATL
- If ATL gives back metadata, stop uploading and break out of the loop
END WHILE LOOP

@Zeugma440
Copy link
Owner

No feedback from the OP for one entire month => Issue closed

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

No branches or pull requests

2 participants