Read tag information from mp3 without downloading entire file C# .Net

I want to read mp3 tag info without downloading entire file e.g. author, title etc.

I know how to download mp3 from URLs

I know how to read mp3 tags - there are a number of libraries

However, I only want to download part of file, enough to get the tag information (author, title etc. etc.)

Thanks
rwallacejAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

käµfm³d 👽Commented:
Is the server one you control?
0
rwallacejAuthor Commented:
no
0
☠ MASQ ☠Commented:
in theory it's possible but because there are two separate ID3 formats you can only get this to work with ID3v2.

ID3v1 Tag format places the metadata at the end of the file so you have to control the whole file before you can extract the details.  Because ID3v2 is designed for streaming audio it puts the data upfront and so is in the first part of the file so you can stop capturing data once you have the whole of the tag.

The downside is there's no fixed size for ID3v2 tags so by design you'll always need to download more than you need to be sure of always capturing all the metadata.

Possible but not a reliable way of getting the information off the files because it depends on the tagging system used and you're generally going to have no idea which you're dealing with.
0
rwallacejAuthor Commented:
Ok, so assume its ID3v2
And try downloading xxx bytes
Then parsing this

The example libraries also seem to load whole files, using the FileStream, but if I'm only downloading xxx bytes using StreamReader Read line then I don't have FileStream
0
käµfm³d 👽Commented:
You cannot (reliably) use ReadLine for anything other than the HTTP headers. The content body of the response is going to be binary data, which may or may not have newline characters in it. You'll need to use the Read method instead; and you should probably use the Read method of the FileStream, not a StreamReader. You can safely use the StreamReader for the headers, but the response body should be read as raw bytes.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.