SIMAV8
  • Intro
  • SIM Builds
    • SIM_BUILDS
    • Gen 1
    • Gen 2
    • Gen 3
  • PROJECTS
    • SIMTrim
    • Carb Heat Switch
    • SIMCNT1
    • SIMGPS
    • SIMCMP
    • SIMSwitches
  • Resources
  • Documents
  • Scenery
  • Contact
  • Freeware!
    • ForeFlight Interface
    • iTunesXMLtoM3U
  • Forum
  • Blog

 iTunesXMLtoM3U  (new version August 2nd, 2021)


I needed a way to generate playlists from my iTunes library for SONOS.   Couldn't find exactly what I wanted out on the InterWebs, so I wrote one.   

What's this do?  It reads your iTunes Music Library.xml file and creates a m3u file for each playlist in iTunes that you want.   
  • Option to Exclude system playlists
  • Create own playlist excludes too
  • Transform the iTunes music path to, for example, your NAS path
  • Replace HTML coded path & filenames (what iTunes uses)
  • Saves playlists non-Unicode (others on the Internet saved in Unicode, which made SONOS very unhappy)

The generated playlists can be used in Windows Media Player, or if on a NAS, your SONOS library can pick up the playlists.   Your iTunes Library can become the "master list" and anytime you want, create playlists that match it for your other devices.

Picture
iTunesXMLtoM3U setup
iTunes XML file to parse:   Utility should find that automatically, if it doesn't, open the file box to left of it and navigate manually.

Target path to create .m3u's in:   This should be an existing folder on your NAS where you want the playlists to go.  

Output path transform PAIRS:  My music is on NAS at \\ds1\music.  I've got a mapped drive M: to \\ds1\music and songs are dragged into iTunes playlist from the M: drive.   But SONOS requires a UNC name, the "transform" says to change occurrences of /M:/ in iTunes to the real UNC path of //ds1/music/.   So literally just type in that field  /M:/ | //ds1/music   (vertical bar is char over the \ key)

And, yes, the slashes are backwards for Windows!   But, that's how they appear in the iTunes XML file so have to be that way.  Example track
   <key>Location</key><string>file://localhost/M:/Secular/Fleetwood%20Mac/Say%20You%20Will/Illume%20911.mp3</string>
After running iTunesXMLtoM3U, the .m3u playlist entry will be transformed to like below which makes SONOS happy (and VLC and WMP to boot)
    \\ds1\music\Secular\Fleetwood Mac\Say You Will\Illume 911.mp3


Exclude Playlists: Click the option box to left of field and program will show you all playlists in iTunes.   You can check the ones you want to exclude like "Voice Memos" and such.   You can also manually type in the box if want, separator is the | character. 

Checkbox Options: Generally you want all of these checked, except perhaps "Remove all existing .m3u in target folder first".

PreM3UHeader: New with 20210802 version.  Some devices or software such as PowerAmp require a M3U tag before each playlist item.   For example, if PreM3UHeader text is "#EXT-X-RATING:0" then the output files will contain 
   #EXTM3U
   #EXT-X-RATING:0
   \\storage\music\MySongOne.mp3
   #EXT-X-RATING:0
   \\storage\music\MySongTwo.mp3


iTunes setup
Newer versions of iTunes don't create an XML file by default.   Turn it on by opening Preferences (Ctrl+, on Windows), go to the Advanced tab (gear icon) then check the option to "Share iTunes Library XML with other applications".   Then iTunes with create a iTunes Music Library.xml file and iTunesXMLtoM3U will have something to read and process.

Picture
Sonos setup
Point SONOS software to playlists on your NAS (or local drive).  I have a NAS and that's where all my music lives, which is why I created this utility in the first place.  iTunes is where I keep playlists organized, but I want SONOS to be able to play the same ones WITHOUT having to create them again in SONOS interface.    

So, configure SONOS to pull playlists from "a Networked device".  

Below are screen shots of the SONOS setup, click on an image to zoom in on it.   On my Synology NAS I created a specific user account for SONOS that only lets it read from the Music folder, put those credentials in the SONOS system interface.   My NAS is named "ds1". 

How to create an account on Synology NAS   

20210802_itunesxmltom3u.zip
File Size: 91 kb
File Type: zip
Download File

The .zip contains just one executable file.   You can put it anywhere and run it, there is no install.  Microsoft dot NET 4.6.1 required, if you have Windows 10 you have that already.
Proudly powered by Weebly