Changes an AT3+ (Atrac 3 plus) header to a valid OMA header (*.aa3) and automatically extracts the smpl area if there is one available (that's the loop points). This is the format used by most of the PSP games and seems also common among PS3 games. The resulting files can be decoded by Sony SoundForge or sometimes played by KMPlayer. The *.smpl files may be injected in decoded wave files again with my smpl_inject (link see first post). However the sample transition at3:wav isn't 1:1 so the loop points are biased and only serve as a help when editing tracks. If somebody could help me adjusting the loop points, that'd be awesome!
Code: Select all
# at3 to aa3 converter for PSP and PS3
# transforms *.at3 files with codec
# identifier 0xfffe into aa3 (=oma) files
# that are decodable by Sony SoundForge
#
# (c) 2012-09-04 by AlphaTwentyThree of XeNTaX
idstring "RIFF"
get SIZE asize
if SIZE == 0
cleanexit
endif
goto 0x14
get CODEC short
if CODEC == 624
cleanexit
endif
goto 0x3c
get INFO long
FindLoc OFFSET string "data" 0 ""
math OFFSET += 4
goto OFFSET
get SIZE long
math SIZE -= 4
get FIRST long
savepos OFFSET
set PSIZE SIZE
math PSIZE += 0x460
putVarChr MEMORY_FILE PSIZE 0
log MEMORY_FILE 0 0
set MEMORY_FILE binary "\x65\x61\x33\x3\x0\x0\x0\x0\x7\x76\x47\x45\x4f\x42\x00\x00\x01\xc6\x00\x00\x02\x62\x69\x6e\x61\x72\x79\x00\x00\x00\x00\x4f\x00\x4d\x00\x47\x00\x5f\x00\x4c\x00\x53\x00\x49\x00\x00\x00\x01\x00\x40\x00\xdc\x00\x70\x00\x08\x00\x00\x00\x00\x00\x00\x4b\x45\x59\x52\x49\x4e\x47"
putVarChr MEMORY_FILE 0x400 0x1334145 long
putVarChr MEMORY_FILE 0x404 0xffff6000 long
putVarChr MEMORY_FILE 0x420 INFO long
putVarChr MEMORY_FILE 0x460 FIRST long
append
log MEMORY_FILE OFFSET SIZE
append
get NAME basename
string NAME += ".aa3"
get SIZE asize MEMORY_FILE
log NAME 0 SIZE MEMORY_FILE
goto 0x5c
getdstring CUE 4
if CUE == "smpl"
get NAME basename
string NAME += ".smpl"
log NAME 0x5c 0x44
endif
goto 0x58
getdstring CUE 4
if CUE == "smpl"
get NAME basename
string NAME += ".smpl"
log NAME 0x58 0x44
endif
goto 0x44
getdstring CUE 4
if CUE == "smpl"
get NAME basename
string NAME += ".smpl"
log NAME 0x58 0x44
endif
goto 0x48
getdstring CUE 4
if CUE == "smpl"
get NAME basename
string NAME += ".smpl"
log NAME 0x58 0x44
endif