CPUM

From IRCBotWiki

Jump to: navigation, search

CPU Killer's Streaming Meta Tags for MP3


I recently came up with this because I like to archive shows from ShoutCast and I would like the title changes to be in the MP3 so it will update as it plays just like the show did... and voila, here it is.

As a MP3 decoder scans for the next MP3 frame, it usually reads a few bytes at a time looking for 0xFF then 0xE0 (or 0xF0 if they are an older decoder that doesn't support MPEG 2.5) in the first two bytes, and here is where my CPUM (CPU Meta) tags come in.

If the 0xFF/0xE0 search fails, check to see if it equals 'CPUM' (0x4D555043 as a Little-endian long), after that there is a status byte which tells which data fields are written to the file.
Data does not have to be null-terminated, but it won't hurt, and DO NOT pad it with spaces!

MSB Status Byte LSB
Bit 7 (0x80) 6 (0x40) 5 (0x20) 4 (0x10) 3 (0x08) 2 (0x04) 1 (0x02) 0 (0x01)
Field Name Forbidden Reserved Reserved Album Genre Artist URL Title
Size (in Bytes) 0 NYD NYD 64 16 64 128 64


The forbidden bit is so MP3 decoders won't mistake the CPUM tag for a valid MP3 frame, also 0xFF should never appear in your data.
Fields will be stored in left-to-right order, ie. if the status byte is 0x03, you would

Read a 64 byte title,
Then a 128 byte URL.

And that is it. Simple yet effective.

  • NYD = Not Yet Determined


IRCBot vde

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

IRCBot Programming
IPC MessagesRemote CommandsPlugin InitializationIRCBot DBShoutIRC Music Database
Tcl Functions
Tcl ScriptingTcl Events
Personal tools