home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Support
Watch / Listen Media
Listen Music
New Music Tagreader
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="hwahrmann" data-source="post: 225641" data-attributes="member: 10391"><p>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.</p><p>But it looks like that no one is using it. </p><p></p><p>WMP inserts some descriptors into the ExtendedContentDescriptors. When you browse a wma file with a hex editor you'll see those as "WM/xxxxxxx".</p><p></p><p>For rating, we're interested in WM/SharedUserRating which is:</p><p>Stars Value</p><p></p><p>1 1</p><p>2 25</p><p>3 50</p><p>4 75</p><p>5 99</p><p></p><p>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.</p><p></p><p>so how to retrieve the value?</p><p></p><p>[CODE]</p><p>// Get the Generic Tag from the WMA file</p><p>File tag = File.Create(@"D:\Temp\output.wma");</p><p></p><p>// Get a tagof type TagLib.Asf.Tag so that we may use the ASF Tag methods</p><p>TagLib.Asf.Tag asftag = tag.GetTag(TagTypes.Asf) as TagLib.Asf.Tag;</p><p></p><p>// Note: This will not work, because rating is a DWORD and Taglib# only return Unicode Values</p><p>string rating = asftag.GetDescriptorString("WM/SharedUserRating");</p><p></p><p>// Because of the above not working, we use the one below to get the rating</p><p>foreach (TagLib.Asf.ContentDescriptor desc in asftag.GetDescriptors("WM/SharedUserRating"))</p><p>{</p><p> if (desc == null)</p><p> continue;</p><p> rating = desc.ToString();</p><p>}</p><p></p><p>Console.WriteLine(ratin);</p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="hwahrmann, post: 225641, member: 10391"] 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); [/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Support
Watch / Listen Media
Listen Music
New Music Tagreader
Contact us
RSS
Top
Bottom