Solved

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

Posted on 2014-11-26
5
316 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 75

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 75

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Recommendation for open source Monitoring 7 98
Map all network 11 89
How we can add Dten600.dll in GAC in c#. 18 54
.NET Redemption/Outlook Examples 3 32
The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
Great sound, comfort and fit, excellent build quality, versatility, compatibility. These are just some of the many reasons for choosing a headset from Sennheiser.
Viewers will get an overview of how to make and use Drum Racks in Ableton Live. Load new Drum Rack into empty MIDI track: Fill rack with audio samples: Re-arrange sample slots as necessary: Adjust parameters of each slot to tailor each sound a…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

734 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