ShoutIRC Music Database

From ShoutIRC RadioBot Wiki
Jump to: navigation, search

ShoutIRC Music Database is (yet another) XML-based format.

There are 2 variants of the format, SMD (a plain XML file), and SMZ, which is a compressed XML file with a custom header.

Compressed SMD Structure

The 16-byte header is like this: (Note: All values are Little Endian!)

SMDZ string, 4 bytes long
compLen, unsigned 32-bit int, the compressed length of the data
fullLen, unsigned 32-bit int, the decompressed length of the data
reserved, 4 bytes of zeros (0x00, not '0')

The file then continues with compLen of zlib compressed data, you decompress it with zlib's uncompress() function

XML Schema

First, there is a standard XML declaration, followed by an SMD element with 2 attributes:

Version="1" (currently the only defined version)
URL=" (this URL, so people can easily find this information)

Under SMD, there is an Info element with these 2 attributes:

NumSongs="X" (the number of songs listed in the XML)
TotalLength="Y" (the combined number of seconds of the files in the playlist)

Next under SMD is a Songs element, which has one or more Song sub-elements representing the individual songs.

Each Song element has several keys describing the song, most are self-explanatory but there are 2 that I should document.

ID="X" - This is a CRC32 of the full path and filename of the song, it serves as a unique identifier for the song. On Win32, the full path and filename is converted to lowercase before CRCing it.
SongLen="Y" - The length in seconds of the song.
mTime="Z" (the last modification time of the file, ie. st_mtime from a stat() call)

Example file

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<SMD Version="1" URL="http://wiki.shoutirc.com/index.php/ShoutIRC_Music_Database">
 <Info NumSongs="4" TotalLength="1104" />
 <Songs>
  <Song ID="1948625078" SongLen="264" mTime="1184011737" Path="F:\FServ\MP3\" FN="Aaliyah - I Care 4 U - Are You That Somebody.mp3" Artist="Aaliyah" Title="Are You That Somebody" Album="I Care 4 U" Genre="Other" />
  <Song ID="1717573007" SongLen="192" mTime="1170372448" Path="F:\FServ\MP3\" FN="Bowling for Soup - 1985 - 1985.mp3" Artist="Bowling for Soup" Title="1985" Album="1985" Genre="Other" />
  <Song ID="51744986" SongLen="366" mTime="1192171596" Path="F:\FServ\MP3\" FN="Bubbles - Super Troopers - Bidibodi Bidibu.mp3" Artist="Bubbles" Title="Bidibodi Bidibu" Album="Super Troopers" Genre="" />
  <Song ID="3690314031" SongLen="282" mTime="1192176018" Path="F:\FServ\MP3\" FN="Nirvana - In Utero - Heart-Shaped Box.mp3" Artist="Nirvana" Title="Heart-Shaped Box" Album="In Utero" Genre="Alternative Rock" />
 </Songs>
</SMD>


RadioBot vde

RadioBot main pages
Main PageInstallationChangelogCommandsPluginsFAQConfigurationCreditsRemote ClientBuilt-In VariablesMulti Sound Server ModeUsername Character Restrictions
Auto DJ Pages
Auto DJ Main PageWebRequest SystemSchedulerMP3 EncoderVoice SupportMySQL Plugin
RadioBot Programming vde

RadioBot Programming
Plugin APIRemote CommandsPlugin InitializationRadioBot DBChanging Command PermissionsShoutIRC Music Database
Lua Scripting
Lua PluginLua ScriptingLua Events
Personal tools