New Music Tagreader (1 Viewer)

hwahrmann

Development Group
  • Team MediaPortal
  • September 15, 2004
    4,633
    2,457
    Vienna, Austria
    Home Country
    Austria Austria
    The existing Tagreader worked very fine and fast.
    However we had some problems when it came to exceptions, like a Tag editor not writing the tags correctly, or special encoders not following exactly 100% the specs.

    It was quite time consuming to get the bugs fixed.
    So we decided to use an open source Tag reader Taglib-Sharp, which supports all file formats that we did with our own tag reader. (well i've added Ape file support yesterday)

    our internal tests have shown that it works perfect and with the same speed as the MP Tagreader.

    Knowing that there are many people out there with different file format, i encourage you to test as much as possible.

    thx,

    Helmut
     

    mbuzina

    Retired Team Member
  • Premium Supporter
  • April 11, 2005
    2,839
    726
    Germany
    Home Country
    Germany Germany
    Hard decision to abandon such a lot of (good) work... Especially only because others can not stick to specs.

    So: Is it in the SVN right now? (You didn't really say that ;-) )
     

    hwahrmann

    Development Group
  • Team MediaPortal
  • September 15, 2004
    4,633
    2,457
    Vienna, Austria
    Home Country
    Austria Austria
    • Thread starter
    • Moderator
    • #3
    yeah, it's bad, but on the long run, we've also write support included.

    it's in svn and is automatically included in the next nightly build
     

    jms969

    Portal Member
    May 12, 2006
    23
    0
    I hate to see you abandon your hard work, but you just keep making MP better and better... Keep up the good work!!!
     

    sukhjinder

    Portal Member
    May 16, 2007
    8
    0
    41
    Home Country
    India India
    From where to download old TagReader

    I'd like to take a look at your TagReader. I tried TagLibSharp and am having some issues with it, like not knowing how to get rating out of Media files. So can you point me to the location of your TagReader.
    Thanks
    Sukhjinder
    http://sukhjinder.co.nr/letsyo
     

    hwahrmann

    Development Group
  • Team MediaPortal
  • September 15, 2004
    4,633
    2,457
    Vienna, Austria
    Home Country
    Austria Austria
    • Thread starter
    • Moderator
    • #6
    Here's how i handle the Rating.
    Code:
    TagLib.File tag = TagLib.File.Create(strFile);
    if (tag.MimeType == "taglib/mp3")
    {
    	// Handle the Rating, which comes from the POPM frame
    	TagLib.Id3v2.Tag id32_tag = tag.GetTag(TagLib.TagTypes.Id3v2) as TagLib.Id3v2.Tag;
    	if (id32_tag != null)
    	{
    		TagLib.Id3v2.PopularimeterFrame popm;
    		foreach (TagLib.Id3v2.Frame frame in id32_tag)
    		{
    			popm = frame as TagLib.Id3v2.PopularimeterFrame;
    			if (popm != null)
    			{
    				int rating = popm.Rating;
    				// Do whatever needed with rating
    			}
    		}
    	}
    }

    currently doing it only for mp3 files, where we have the rating in the popm frame.
     

    sukhjinder

    Portal Member
    May 16, 2007
    8
    0
    41
    Home Country
    India India
    Thanks But What About MP's TagRreader

    Thanks for the Reply. I found that the method proposed by you for TagLibSharp woks well. But I'd love to check out the TagReader MediaPortal used to use before switching to TagLibSharp. So can I please have the URl from where to download it.

    Thanks...
     

    hwahrmann

    Development Group
  • Team MediaPortal
  • September 15, 2004
    4,633
    2,457
    Vienna, Austria
    Home Country
    Austria Austria
    • Thread starter
    • Moderator
    • #8
    PM me your mail address and i'll drop you a mail

    As an alternative you can get the source code of MP from mid of August out of SVN
    this contains the tagreader source.
     

    sukhjinder

    Portal Member
    May 16, 2007
    8
    0
    41
    Home Country
    India India
    Get Rating from WMA files?

    Thanks for the code to get the rating from .mp3 files using TagLibSharp. Can you please guide me as to how can I do the same for wma files.

    Thanks
    Sukhjinder...
    http://sukhjinder.co.nr/letsyo

    P.S: I understand that this is not a forum for TagLib# but I'm hoping that I will get some help here.
     

    hwahrmann

    Development Group
  • Team MediaPortal
  • September 15, 2004
    4,633
    2,457
    Vienna, Austria
    Home Country
    Austria Austria
    • Thread starter
    • Moderator
    • #10
    As per ASF specification you should find the rating as a dword in the ContentDescriptor. The content descriptor should also be there for title, author, etc.
    But it looks like that no one is using it.

    WMP inserts some descriptors into the ExtendedContentDescriptors. When you browse a wma file with a hex editor you'll see those as "WM/xxxxxxx".

    For rating, we're interested in WM/SharedUserRating which is:
    Stars Value

    1 1
    2 25
    3 50
    4 75
    5 99

    Normally you can get the descriptor strings in taglib# with GetDescriptorStrin. However as the rating is a dword, taglib# does return null. I'll talk to Brian about that.

    so how to retrieve the value?

    Code:
    // Get the Generic Tag from the WMA file
    File tag = File.Create(@"D:\Temp\output.wma");
    
    // Get a tagof type TagLib.Asf.Tag so that we may use the ASF Tag methods
    TagLib.Asf.Tag asftag = tag.GetTag(TagTypes.Asf) as TagLib.Asf.Tag;
    
    // Note: This will not work, because rating is a DWORD and Taglib# only return Unicode Values
    string rating = asftag.GetDescriptorString("WM/SharedUserRating");
    
    // Because of the above not working, we use the one below to get the rating
    foreach (TagLib.Asf.ContentDescriptor desc in asftag.GetDescriptors("WM/SharedUserRating"))
    {
         if (desc == null)
            continue;
            rating = desc.ToString();
    }
    
    Console.WriteLine(ratin);
     

    Users who are viewing this thread

    Top Bottom