Solved

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

Posted on 2014-11-26
5
282 Views
Last Modified: 2015-01-05
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
0
Comment
Question by:rwallacej
  • 2
  • 2
5 Comments
 
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 40467667
Is the server one you control?
0
 

Author Comment

by:rwallacej
ID: 40467688
no
0
 
LVL 62

Expert Comment

by:☠ MASQ ☠
ID: 40467731
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
 

Author Comment

by:rwallacej
ID: 40467772
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
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 40467784
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

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I previously wrote an article addressing the use of UBCD4WIN and SARDU. All are great, but I have always been an advocate of SARDU. Recently it was suggested that I go back and take a look at Easy2Boot in comparison.
Skype is a P2P (Peer to Peer) instant messaging and VOIP (Voice over IP) service – as well as a whole lot more.
Viewers will learn key ranges in Sampler to make their sampled instruments sound more realistic Gather samples of various notes and drag them to Key Range panel: Set proper root key for each sample: Select all the samples with Command-A (or Ctrl…
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now