Format:SDAT (Nitro sound archive)
Appearance
| Magic | 53 44 41 54 ("SDAT") at offset 0 |
|---|---|
| Extensions | .sdat |
| Endianness | little |
| On this wiki | Facts · Code · Notes · Topics |
Sound data archive (.sdat) of Nintendo DS games: header magic SDAT with offsets to SYMB (symbols), INFO (records) and FAT/FILE blocks containing SSEQ sequences, SBNK banks, SWAR wave archives and STRM streams.
Layout
Checked against ndspy soundArchive.py (RoadrunnerWMC/ndspy, GPL-3.0, commit 00165f1; read at lines 60-82 and 139-222, writer at 762-834). Little endian throughout.
- Header (0x40 bytes): the common Nitro header
<4s H H I H Hwith magicSDAT, byte-order mark 0xFEFF (bytesFF FE), version 0x0100 (bytes00 01; ndspy rejects any other value), file size, header size 0x40, block count 4; then at 0x10 four (offset, size) pairs of u32: SYMB, INFO, FAT, FILE. The header is padded to 0x40. - SYMB (symbol names; the offset can be 0 when the archive has no symbols): tag
SYMB, u32 size, then 8 u32 offsets to name lists (one per INFO record type), each a u32 count followed by offsets to NUL-terminated names relative to the SYMB block. The sequence-archive list has a sub-list per entry. - INFO: tag
INFO, u32 size, then 8 u32 offsets (relative to the INFO block) to record tables, in this order: sequences (SSEQ), sequence archives (SSAR), banks (SBNK), wave archives (SWAR), players, groups, stream players, streams (STRM). Each table is a u32 count followed by that many u32 offsets to the records; an offset of 0 is an empty slot. - FAT (note the trailing space in the tag,
FAT): tag, u32 size, u32 file count, then 16-byte entriesu32 offset (from the start of the SDAT file), u32 size, 8 padding bytes. Entries are indexed by the file ids that INFO records hold. - FILE: tag
FILE, u32 size, u32 file count (ndspy writes these 12 bytes), then the embedded files at the FAT offsets, aligned (ndspy detects 0x200 as the usual alignment and lowers it when offsets say so). Each embedded file (SSEQ,SBNK,SWAR,SSAR,STRM) starts with its own 16-byte Nitro header with its tag.
The sizes inside FAT may include or exclude the padding to the next file: ndspy keeps a flag fatLengthsIncludePadding, true unless some entry's size differs from the distance to the next entry's offset (Fact:SDAT (Nitro sound archive)/behavior/FAT sizes and file alignment). Compare file sizes only after reading the embedded header's own size field.
Code & repositories
- https://github.com/RoadrunnerWMC/ndspy @
00165f177d03c6ca9e15e37decf54d9c6754bf54· license: GPL-3.0
ndspy (GPL-3.0): Python library reading and writing NDS ROMs, NARC and SDAT archives; narc.py and soundArchive.py give the exact headers, block tags and record tables. Read for format facts only.
Tested on: source read, not run: Read at this commit; not run. · checked 2026-10-18; last activity 2026-08-29