{"id":2958,"date":"2007-02-18T12:34:40","date_gmt":"2007-02-18T17:34:40","guid":{"rendered":"http:\/\/scruss.com\/blog\/2007\/02\/18\/spiff-with-a-silent-x\/"},"modified":"2007-08-15T22:50:51","modified_gmt":"2007-08-16T02:50:51","slug":"spiff-with-a-silent-x","status":"publish","type":"post","link":"https:\/\/scruss.com\/blog\/2007\/02\/18\/spiff-with-a-silent-x\/","title":{"rendered":"spiff with a silent X"},"content":{"rendered":"<p>I&#8217;ve been playing with <a href=\"http:\/\/www.xspf.org\/\" title=\"XML Shareable Playlist Format\">XSPF<\/a>, mostly so I can use the <a href=\"http:\/\/musicplayer.sourceforge.net\/\">XSPF Web Music Player<\/a>. There&#8217;s a Perl API for working with XSPF (<a href=\"http:\/\/search.cpan.org\/~daniel\/XML-XSPF-0.6\/lib\/XML\/XSPF.pm\">XML::XSPF<\/a>) which works well, but is extremely short on documentation.<\/p>\n<p>Creating a playlist with XML::XSPF is pretty logical: create a new track object for each new track, then feed an array of these tracks into the playlist object. It took me a couple of hours of fiddling about (and much use of <a href=\"http:\/\/search.cpan.org\/~ovid\/Data-Dumper-Simple-0.11\/lib\/Data\/Dumper\/Simple.pm\">Data::Dumper::Simple<\/a>, the plain man&#8217;s guide to tortuous data structures) to find that out.<\/p>\n<p>The end result is this:<br \/>\n<a href=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2007\/02\/id32xspf\">id32xspf &#8211; create XSPF playlist to stdout from a list of MP3s with ID3v2 tags<\/a>.<br \/>\nIt&#8217;s intended for use on a local directory of MP3s, which will subsequently be uploaded to a website. It uses <a href=\"http:\/\/search.cpan.org\/~daniel\/MP3-Info-1.21\/Info.pm\">MP3::Info<\/a> to do the tag work.<br \/>\nIt has some limitations:<\/p>\n<ul>\n<li>every file must have ID3v2 tags.<\/li>\n<li>it doesn&#8217;t handle <tt>file:\/\/<\/tt> locations at all well, as their syntax is system-dependent. You&#8217;ll probably have to use the <tt>--urlbase<\/tt> option. For example, for Unix systems  for local files in the current directory, I find <tt>-u file:\/\/`pwd`\/<\/tt> works well.<\/li>\n<li>it doesn&#8217;t include track numbers, as I didn&#8217;t know that XSPF supported them.<\/li>\n<li>it doesn&#8217;t create track artwork links, as this isn&#8217;t included in ID3 data.<\/li>\n<\/ul>\n<p>One slightly amusing caveat about the XSPF Web Music Player is that it doesn&#8217;t understand the rate of some of <a href=\"http:\/\/lame.sourceforge.net\/\">lame<\/a>&#8216;s more amusing VBR presets. If you feed it files from the voice preset (56kbit, mono, resampled to 32000Hz), the results sound like <a href=\"http:\/\/www.pinkyandperky.com\/\">Pinky &amp; Perky<\/a> &#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been playing with XSPF, mostly so I can use the XSPF Web Music Player. There&#8217;s a Perl API for working with XSPF (XML::XSPF) which works well, but is extremely short on documentation. Creating a playlist with XML::XSPF is pretty logical: create a new track object for each new track, then feed an array of [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[14,7],"tags":[800,45,47,187,799,44],"class_list":["post-2958","post","type-post","status-publish","format-standard","hentry","category-choons","category-computers-suck","tag-flash","tag-mp3","tag-music","tag-perl","tag-playlist","tag-xspf"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pQNZZ-LI","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/2958","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/comments?post=2958"}],"version-history":[{"count":0,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/2958\/revisions"}],"wp:attachment":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/media?parent=2958"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/categories?post=2958"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/tags?post=2958"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}