SPC is an audio format for playing native SNES audio.
|33||File header “SNES-SPC700 Sound File Data v0.30”|
|1||Version Minor (i.e. 30)|
|SPC700 Registers||1||SP (Lower Byte)|
|ID666 Tag (Text Format)||32||Song Title|
|ID666 Tag (Text Format)||32||Game Title|
|ID666 Tag (Text Format)||16||Name of Dumper|
|ID666 Tag (Text Format)||32||Comments|
|ID666 Tag (Text Format)||11||Date SPC was Dumped (MM/DD/YYYY)|
|ID666 Tag (Text Format)||3||Number of Seconds to Play Song before Fading Out|
|ID666 Tag (Text Format)||5||Length of Fade in Milliseconds|
|ID666 Tag (Text Format)||32||Artist of Song|
|ID666 Tag (Text Format)||1||Default Channel Disables
0 = Enable
1 = Disable
|ID666 Tag (Text Format)||1||Emulator used to dump SPC
0 = Unknown
1 = ZSNES
2 = Snes9x
|ID666 Tag (Text Format)||45||Reserved (Set to
|ID666 Tag (Binary Format)||32||Song Title|
|ID666 Tag (Binary Format)||32||Game Title|
|ID666 Tag (Binary Format)||16||Name of Dumper|
|ID666 Tag (Binary Format)||32||Comments|
|ID666 Tag (Binary Format)||4||Date SPC was Dumped (YYYYMMDD)|
|ID666 Tag (Binary Format)||7||Unused|
|ID666 Tag (Binary Format)||3||Number of Seconds to Play Song before Fading Out|
|ID666 Tag (Binary Format)||4||Length of Fade in Milliseconds|
|ID666 Tag (Binary Format)||32||Artist of Song|
|ID666 Tag (Binary Format)||1||Default Channel Disables
0 = Enable
1 = Disable
|ID666 Tag (Binary Format)||1||Emulator used to dump SPC
0 = Unknown
1 = ZSNES
2 = Snes9x
|ID666 Tag (Binary Format)||46||Reserved (Set to
|64||Extra RAM (Memory Region used when the IPL ROM region is set to read-only)|
Extended information is stored at the end of the SPC file as a RIFF chunk with an ID of
xid6. Items that can be stored in the ID666 tag without any loss of data should not be stored in the extended area.
|0||4||Chunk type, ie
|4||4||Chunk size, not including header|
Inside the chunk are sub-chunks. Each sub-chunk consists of a 4-byte header, and possibly data. All data is 32-bit aligned. If the data stored doesn’t reach a 32-bit boundary, it will be padded with 0’s.
|0||1||ID: Song Name, Length, etc.|
0 = Data is stored in the header
Non-Zero = data is stored after header
If ‘Type’ = Zero, this contains the data
If ‘Type’ is non-zero, this contains the length of the data following the header
ID: 00-0F - Items from original ID666 tag 10-1F - Extended items 30-3F - Items related to playback Type: 00 Data - Data is saved in the 'data' item of the sub-chunk header. 01 String - Data is stored as a null terminated string (max 256 characters including null). Strings are saved using 8-bit character encoding. Support for unicode may be added in the future. 04 Integer - Data is stored as a 32-bit integer.
Size: The minimum and maximum sizes of an item.
|05h||Integer||4||Date Song was Dumped (stored as YYYYMMDD)|
|10h||String||4-256||Official Soundtrack Title|
|12h||Data||2||OST Track (upper byte is the number 0-99, lower byte is an optional ASCII character)|
|30h||Integer||4||Introduction Length (lengths are stored in 1/64000th seconds)|
|34h||Data||1||Muted Voices (a bit is set for each voice that’s muted)|
|35h||Data||1||Number of Times to Loop|
|36h||Data||1||Mixing (Preamp) Level|
Lengths are stored in ticks. A tick is 1/64000th of a second. The maximum length is 383999999 ticks. The End can contain a negative value.
This may seem like a messy way to implement a format, but I wanted to assure something that would be easily expandable. The source code to SNESAmp contains a C++ class for reading and writing ID666 and xid6 tags.
RSN is a packed/grouped format for SPC files.
Often, SPC files will only differ by a few KB, with the rest bit-identical. For example, several songs might all use the same playback code and set of samples, with only the module data (or even just the playback pointer) differing between songs. But because PKZIP always compresses each file as a separate object, it can’t take advantage of similarities between files. Even tar.gz, which combines the files before compressing them into a “solid archive”, could only reference data from the past 32768 bytes. RAR was the first widely used general data compression program that used a window bigger than a single SPC file, so SPC sets were often distributed as RAR files.
The one disadvantage of RAR is that it is not free software due to a license term prohibiting reverse-engineering the format to create a description of the compression method:
The UnRAR sources may be used in any software to handle RAR archives without limitations free of charge, but cannot be used to re-create the RAR compression algorithm, which is proprietary. Distribution of modified UnRAR sources in separate form or as a part of other software is permitted, provided that it is clearly stated in the documentation and source comments that the code may not be used to develop a RAR (WinRAR) compatible archiver.
7-Zip and tar.bz2 are free alternatives to RAR, but RAR had the first mover advantage, and music archives that already deal in non-free music have seen no need to repack in a free format.
Windows Explorer (the file manager in Windows) uses the part of the filename after the last period character (“the extension”) to determine file type. That’s why various file formats based on PKZIP archives have different extensions: .zip for general data, .jar for Java applications, .smzip for StepMania, .cbz for sequences of JPEG or PNG images (“comic book zip”), .odt for OASIS text documents, .ods for OASIS spreadsheets, etc. Likewise, RAR has .rar for general data, .cbr for image sequences, and .rsn (RAR Super Nintendo) for sets of SPC files.
The first player to support RSN files was Winamp, which does not support playing files from archives in general. Input plug-ins for archives exist; they unpack an archive’s contents to a temporary folder and then open the resulting files with the correct input plug-in.
Players such as foobar2000 do not require the RSN hack since the player itself can support RAR files directly. Of course, you probably don’t want to associate RAR files with the audio player, but you can still drag the archives onto the player, as well as open them within the player, and they can contain more than just SPC files. Although most general purpose audio formats are already compressed, so they don’t really benefit from being stuffed into other archive formats.
SPC File Format v0.31 by creaothceann, 2006-02-27 21:48