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
Solved

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

Posted on 2014-11-26
5
301 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 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
Viewers will learn how to use LFOs to modulate the sound of their Sampler instruments. Click the Modulation tab in Sampler: Choose one (or more) of the three available LFOs, and click the respective button to turn it on: Select a waveform, an LF…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

829 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