SdatArchive

data class SdatArchive(val sequences: List<SdatSseqFile>, val banks: List<SdatSbnkFile>, val waveArchives: List<SdatSwarFile>, val streams: List<SdatStrmFile>)

Reads and writes Nintendo DS SDAT (Sound Data Archive) container files.

SDAT binary layout (all fields little-endian):

Main header – 0x40 bytes 0x00 magic "SDAT" 0x04 BOM FE FF 0x06 version 01 00 0x08 total size (u32) 0x0C header size 40 00 0x0E numBlocks (u16) 2–4 0x10 symbOffset (u32, 0 if absent) 0x14 symbLength (u32, 0 if absent) 0x18 infoOffset (u32) 0x1C infoLength (u32) 0x20 fatOffset (u32) 0x24 fatLength (u32) 0x28 fileOffset (u32) 0x2C fileLength (u32) 0x30 reserved 16 zero bytes

SYMB block – optional 0x00 magic "SYMB", 0x04 block size 0x08 8 × u32 record-slot offsets (relative to SYMB block start) slot 0=SSEQ, 2=SBNK, 3=SWAR, 7=STRM (others unused) Each slot: u32 nEntries, nEntries × u32 string offsets (rel. to SYMB start; 0=unnamed) Each string: null-terminated ASCII

INFO block – required 0x00 magic "INFO", 0x04 block size 0x08 8 × u32 record-slot offsets (relative to INFO block start) Each slot: u32 nEntries, nEntries × u32 entry offsets (rel. to INFO start; 0=deleted) SSEQ entry (12 bytes): u16 fileId, u16 unk, u16 bank, u8 vol, u8 chanPri, u8 plrPri, u8 players, u82 SBNK entry (12 bytes): u16 fileId, u16 unk, u164 wars SWAR entry (4 bytes): u16 fileId, u16 unk STRM entry (12 bytes): u16 fileId, u16 unk, u8 vol, u8 prio, u8 players, u85

FAT block – required magic "FAT " (0x46415420) 0x08 u32 nEntries; each entry 16 bytes: u32 absOffset, u32 length, 8 reserved

FILE block – required magic "FILE", 0x08 u32 nFiles, 4 reserved, raw file data

Constructors

Link copied to clipboard
constructor(sequences: List<SdatSseqFile>, banks: List<SdatSbnkFile>, waveArchives: List<SdatSwarFile>, streams: List<SdatStrmFile>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

All SBNK bank files in archive order.

Link copied to clipboard

All SSEQ sequence files in archive order.

Link copied to clipboard

All STRM stream files in archive order.

Link copied to clipboard

All SWAR wave-archive files in archive order.

Functions

Link copied to clipboard

Finds a bank by its symbolic name.

Link copied to clipboard

Finds a sequence by its symbolic name.

Link copied to clipboard

Finds a stream by its symbolic name.

Link copied to clipboard

Finds a wave archive by its symbolic name.