Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

XC 2 > Audio Files

This page describes the .nop (Nintendo OPus) file format, which is based on the opus format but with a custom header.

The file is encoded with little endian byte order.

To listen to these files, you can use Foobar2000 with the VGMstream plugin or the VGMstream website directly.

OffsetSizeDescription
0x00x60File Header
0x600x20Padding
0x80?Seek Table
?0x28Opus Header
??Opus Stream

A frame is the work unit for the file format. One frame is 20 ms and approximately 960 samples

File Header

OffsetSizeDescription
0x04Always "sadf"
0x44File size
0x84Always "opus"
0xC4Always 1
0x104Always "head"
0x144Seek table position (0x80)
0x184Channel count (1 or 2)
0x1C4Raw opus start position
0x204Raw opus length (without padding)
0x244Sample rate (e.g. 48 000 Hz)
0x284Number of samples
0x2C4Loop start
0x304Number of samples (bis) / loop end
0x344Raw opus length (without padding) (bis)
0x384Unknown (always 0?)
0x3C4Unknown (always 0?)
0x404Unknown (64,000 or 96,000)
0x444Unknown (20,000)
0x484Unknown (always 0?)
0x4C4Number of frames (without the first and last 4 bytes of seek table so it’s X-2)
0x504Number of frames (bis)
0x544Seek table position (bis) (0x80)
0x584Total length of the seek table
0x5C4Always 0?
0x6032Padding

Seek Table

The size of a frame can be determined by calculating the difference between two consecutive offsets.

OffsetSizeDescription
0x80428 00 00 00 Payload’s header length / seek table start
0x??4The last 4 bytes give the payload length without the payload’s padding
0x??Padding (E8 E8 E8 E8 …)

The seek table is padded with 0xE8 until its size is a multiple of 16 bytes

Opus Header

(first frame, offset is reset for simplicity)

OffsetSizeDescription
0x0401 00 00 80 magic
0x4418 00 00 00 = ?
0x81Unknown
0x911 = Mono, 2 = Stereo
0xA2Unknown
0xC4Sample rate (e.g. 48,000)
0x10420 00 00 00 = ?
0x14400 00 00 00 0
0x18400 00 00 00 0
0x1C478 00 00 00 = 120 : ?
0x20404 00 00 80 ?
0x244Length of the file’s rest (without the padding)

Opus Stream

OffsetSizeDescription
0x04Frame length (big endian)
0x44Metadata ?
0x82Config byte

00 00 00 03 01 00 00 00 FC FF FE = 1 frame of silence, can vary a little

To find a frame, search for 00 00 after the first frame, take note of the two following values, skip 4 bytes. Now, select the bytes until you see another 00 00. If the length corresponds to the value, it’s a frame!

Every opus stream is padded will null bytes until its size is a multiple of 16 bytes