Attack on Titan: Wings of Freedom KTSC/KTRS (Ogg derivative?)

Codecs, formats, encoding/decoding of game audio, video and music
McCunyao
Posts: 21
Joined: Fri Jan 06, 2017 12:33 pm

Attack on Titan: Wings of Freedom KTSC/KTRS (Ogg derivative?)

Post by McCunyao »

Hi, newbie on the forums here (Just did the skip form the other place). I've taken a look at the AoT: Wings of Freedom sound files, and it seems that in the music they use the KTSL format, but other files seem to have a different format. Anyone from the old One Piece/Dynasty Warriors formats want to take a look?

Thanks in advance.
McCunyao
Posts: 21
Joined: Fri Jan 06, 2017 12:33 pm

Re: Attack on Titan: Wings of Freedom KTSC/KTRS (Ogg derivative?)

Post by McCunyao »

Hey there again. I've ended up doing a bit of research and I'm almost close to finding out how to extract the audios from the PC version, but no cigar.

The KTSR format seems to be Microsoft ADPCM (The game uses XAudio2) for the PC version and AT9 for the PSVita version. But I can't find the byte rates and the audio block align contents. I was hoping if someone could help me finish the job...

Here's the specs I've found.

Code: Select all

CONTENTS IN LITTLE-ENDIAN
MAIN KTSR HEADER
0x00: Magic word KTSR
0x04: 0x1A487B77
0x08: 0x0100
0x0A: Console format: 0x0001 for PC, 0x0203 for PSVita
0x0C: 0x4ACAC960
0x10: 0x00
0x18: Entire file size
0x1C: Entire file size
0x20: 0x00

KTSR INDIVIDUAL SOUND HEADERS
STARTING AT 0x40 GOES EACH PIECE OF THE HEADER, VARIABLE SIZE THE CONTENTS OF THIS PART SEEM TO BE ALMOST EXACTLY THE SAME BETWEEN CONSOLES (EVEN WITH THE SAMPLE RATE VARIATIONS), SO THERE'S A CHANCE THERE'S NO NEED TO CHANGE THIS AREA.
FIRST SECTION
0x04 bytes: 0x368C88BD
0x04 bytes: Entire header size (Usually 0xF0 or 0x1E0)
(Ignore the rest of the piece)
CONTINUE WITH ONE PIECE OF HEADER PER FILE, THEN PROCEED TO ACTUAL SOUND FILES.

SOUND FILE:
FIRST SECTION
0x04 bytes: 0x70CBCCC5
0x04 bytes: Entire sound file size
0x04 bytes: Unknown variable data. Might be related with miliseconds/sound size content.
0x04 bytes: 0x00
0x04 bytes: 0x01
0x04 bytes: Pointer to the pointer to the second section, after the sound name (Variable)
0x04 bytes: Position of the sound name (Variable)
0xXX bytes: Sound name (ASCII)
0x04 bytes: Pointer to the second section (ALWAYS ALIGNED TO 0x08 BYTES)
SECOND SECTION
0x04 bytes: Unknown variable data (0xF973F26F or 0x4EBDFD41)
0x04 bytes: File size (Starting at the beginning of the block)
0x04 bytes: Unknown variable data (0xD2DB2960 or 0x09F76FDC)
0x04 bytes: 0x01. Might be the number of channels.
0x04 bytes: Unknown variable data. Usually 0x1000. Might be the block align.
0x04 bytes: Sample rate
0x04 bytes: Sample number (One file had a higher amount than the real data, another one had the exact one. Might be rounded?)
0x04 bytes: Unknown variable data. Might be related with platform (PC has 0x00, VITA has 0x0100)
0x04 bytes: 0xFFFFFFFF
0x04 bytes: Unknown variable data.
0x04 bytes: Pointer to the format identifier (Starting at the beginning of the second section, ALIGNED TO 0x08 BYTES)
0x04 bytes: Pointer to the sound contents position value (Starting at the beginning of the second section)
0x04 bytes: Pointer to the sound contents size value (Starting at the beginning of the second section)
FILL WITH 0x00 UNTIL THE NEXT PART IS ALIGNED TO 0x08 bytes
0x04 bytes: Some sort of format identifier (0x01060200 for PC, 0x00A00400 in VITA)
 - IF THE FORMAT IDENTIFIER IS FROM VITA:
 - 0x04 bytes: Bitrate information (The one found at the 0x40 position in the RIFF header of an AT9 file):
   - 0x01 byte: 0xFE
   - 0x01 byte:
        - 0x70 = 1 channel
        - 0x74 = 2 channels
   - 0x01 byte:
        - 0x02 = 36 kbps, byte rate 4500, audio block align 96
        - 0x03 = 48 kbps, byte rate 6000, audio block align 128
        - 0x04 = 60 kbps, byte rate 7500, audio block align 160
        - 0x05 = 72 kbps, byte rate 9000, audio block align 192
        - 0x06 = 84 kbps, byte rate 10500, audio block align 224
        - 0x07 = 96 kbps, byte rate 12000, audio block align 256
        - 0x09 = 120 kbps, byte rate 15000, audio block align 320
        - 0x0B = 144 kbps, byte rate 18000, audio block align 384
        - 0x0D = 168 kbps, byte rate 21000, audio block align 448
        - 0x0E = 192 kbps, byte rate 24000, audio block align 512
   - 0x01 byte: 0xF0
0x04 bytes: Sound contents position (Starting at the beginning of the second section, ALIGNED TO 0x10 BYTES)
0x04 bytes: Sound contents size
FILL WITH 0x00 UNTIL THE NEXT PART IS ALIGNED TO 0x10 bytes
0xXX bytes: Sound contents


I'm also attaching another batch of samples.