Read MP3 Tags with Silverlight got me started with reading id3 t开发者_运维技巧ags, but i realize that taglib# online deals with local file paths ?
Is there a way of reading this info from a remote file ?
I recently answered the same question for Ruby (see below) - I'm pretty sure you can do something similar.
The idea is:
use HTTP 1.1 protocol or higher, and a Range HTTP-request.
download the beginning section (100 bytes) of the ID3v2-tag
from the first few bytes downloaded, you can determine the correct length of the complete ID3v2 tag, e.g. N
download the first N bytes of the file (e.g. the complete ID3v2-tag)
parse the ID3v2 tag for your purposes
See:
Read ID3 Tags of Remote MP3 File in Ruby/Rails?
Tim Heuer has a good blog post on doing this. http://timheuer.com/blog/archive/2010/01/30/reading-mp3-id3-tags-with-silverlight-taglib.aspx
Like yourself, he also ran into the problem of TabLib# only using local paths.
One thing that TagLib# didn’t have was a stream input implementation. Most of the libraries, in fact, assumed a local file path. Luckily the library was written using a generic ‘File’ interface, so I just had to create my own StreamFileAbstraction. I chose to do this within my project rather than the base library. It was easy since the LocalFileAbstraction actually perfomed an Open on the file as it’s first task and set some public variables. My abstraction basically just hands the stream already and ready to go.
There is an example on the novell site that uses file abstraction. http:// developer.novell.com/wiki/index.php/TagLib_Sharp:_Examples
精彩评论