Psychonauts ISB

From XentaxWiki
Jump to: navigation, search

ISB


Format Specifications

// ARCHIVE HEADER

char {4}     - Header (ZPKG)
uint32 {4}   - Version (1)
uint32 {4}   - First File Offset
char {4}     - Header (RIFF)
uint32 {4}   - File Size (- 8)
char {8}     - (isbftitl)
uint32 {4}   - Size of Text Block
byte {X}     - Text Block


// Repeated throughout file

char {4}     - Block Name
uint32 {4}   - Block Size (not including 8 bytes for block name and size)
byte {X}     - Block Data

Seek through the blocks unless the block is one of those below:

// LIST Block

char {4}     - Header (LIST)
uint32 {4}   - Block Size (Including all sub-blocks)
char {8}     - Dummy Title? - (Usually 'sampltitl')
uint32 {4}   - Size of Filename
byte {X}     - Filename (Each letter is separated by a 0 byte))

The filename sometimes has the incorrect file extension so you'll want to remote this and replace it with the correct one. However sometimes the file extension has '-loop' tagged on the end eg 'AsylumExt.aif-Loop' - if you remove the file extension then this file would become 'AsylumExt' - but there is already a file with this name so you'd need to add 'loop' back to the filename somehow to make it a unique name eg 'AsylumExt-Loop'.

// SINF Block

char {4}     - Header (SINF)
uint32 {4}   - Block Size
uint32 {8}   - ?
uint32 {4}   - Samplerate
uint32 {8}   - ?

// CHNK Block

char {4}     - Header (CHNK)
uint32 {4}   - Block Size
uint32 {4}   - Number of Channels

// CMPI Block

char {4}     - Header (CMPI)
uint32 {4}   - Block Size
uint32 {20}   - ?
uint32 {4}   - Wav Identifier (If = 1053609165 then its a normal pcm wav, otherwise its xbox adpcm)

// DATA Block

char {4}     - Header (DATA)
uint32 {4}   - Block Size (Sometimes has 1 byte padding so: if blocksize mod 2 <> 0 then blocksize:=blocksize + 1 )
byte {X}     - File Data

Dump the file data then continue on to next LIST block. Repeat until you reach end of file.


// DUMPING FILES
If first 4 bytes of file data='OggS' then its an ogg file. Otherwise its always an xbox or normal pcm wav.
If its an ogg file then just copy out 'Block Size' bytes.
If its a wav file though you need to write the .wav header first:

You need to write the following:

char {4}     - RIFF Header ('RIFF')
uint32 {4}   - Block Size + 40
char {4}     - WAVE Header ('WAVE')
char {4}     - fmt Header ('fmt ')
uint32 {4}   - Size of fmt block (20)
byte {2}     - PCM Code (If its normal pcm then = 1. If its xbox adpcm then = 105)
byte {2}     - Number of Channels
uint32 {4}   - Samplerate
uint32 {4}   - Byterate (If its normal pcm then = (SampleRate * No Channels * 16) div 8 . If its xbox adpcm then = No Channels * 24806)
byte {2}     - Block Align (If its normal pcm then = 16. If its xbox adpcm then = 4)
byte {2}     - Bits Per Sample (If its normal pcm then = (No Channels * 16) div 8. If its xbox adpcm then = No Channels * 36 )
uint32 {4}   - Extra Data (If its normal pcm then = 16. If its xbox adpcm then = 4194306)
char {4}     - DATA Header ('DATA')
uint32 {4}   - Data Block Size (Size of data block in archive)

Extra Checks:
Sometimes the Number of Channels=0 so change this to 1.

Notes and Comments

ISB files contain the audio data and are only used in the pc version, the xbox and ps2 versions store audio differently. ISB files contain 3 types of audio:

Ogg - Standard Ogg Audio
PCM - Standard Wave PCM
Xbox ADPCM - As used by many Xbox games

The OGG and PCM audio can be played easily, to play the Xbox ADPCM however you either need to pass it through a decoder (there's one in Psychonauts Explorer) or install the Xbox ADPCM codec.

Supported Programs