AlphaTwentyThree wrote:
WAVE format scanner
I already posted this inside some other topic but I'll include it here, too. Simple wave scanner. Doesn't search for the "RIFF" string as I once accidentially found it inside some other data structures where it wasn't a wave file. Instead it searches for the WAVEfmt part and extracts the file.
for i = 1
FindLoc OFFSET STRING "WAVEfmt" 0 ""
if OFFSET != ""
math OFFSET -= 8
goto OFFSET
FindLoc DATA STRING "data" 0 ""
math DATA += 4
goto DATA
get SSIZE long
savepos HEADER
math HEADER -= OFFSET
set SIZE HEADER
math SIZE += SSIZE
get NAME basename
string NAME += "_"
string NAME += i
string NAME += ".wav"
log NAME OFFSET SIZE
else
cleanexit
endif
next i
Thank you!
Sorry for my English... It is not my native language.
Can you make a script for flashing these wav files back to the original file? It would be great for mods.
These are just PS2 ADPCM streams with a fake AT3 header. Just use this simple script below on them and play them with the vgmstream plugin (Winamp).
As you can see, the script only an altered version of the SS2 header adder script with some "get" commands to retrieve the fitting parameters. Anyone can adjust my scripts like that - I use that method all the time because it's so easy.
idstring "RIFF"
goto 0x16
get CH short
get FREQ long
set INTERLEAVE 0x10
set OFFSET 0x4c
get NAME basename
string NAME += ".ss2"
callfunction SS2 1
get SIZE asize MEMORY_FILE
log NAME 0 SIZE MEMORY_FILE
startfunction SS2
get SIZE asize
math SIZE -= OFFSET
set MEMORY_FILE binary "\x53\x53\x68\x64\x18\x00\x00\x00\x10\x00\x00\x00\xb0\x36\x00\x00\x02\x00\x00\x00\xc0\x2f\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x53\x53\x62\x64\x00\xe8\x11\x00"
append
log MEMORY_FILE OFFSET SIZE
append
putVarChr MEMORY_FILE 0xc FREQ long
putVarChr MEMORY_FILE 0x10 CH byte
putVarChr MEMORY_FILE 0x14 INTERLEAVE long
putVarChr MEMORY_FILE 0x24 SIZE long
endfunction
Also does your file deinterleave script work for blocked files?
EDIT: NVM it worked great on that interleaved atrac3 file from full auto 2 i posted here, 0x6000 itnelreaved with 8 streams, end of the track screwes up a bit though.
EDIT: After taking another look it is not your script, it works correctly. It is the file that something is wrong, i Manually splitted the segments and it seems the ending segments are messed up.
EDIT: After taking another look it is not your script, it works correctly. It is the file that something is wrong, i Manually splitted the segments and it seems the ending segments are messed up.
How many channels does this file have? I tried different aa3 headers but found no working one...
SoundNodeWave_to_uxma
Converts UT3-engine sounds from Xbox 360 games to unparsed XMA streams. Automatically adds the frequency to the filename for later use with my updated script for XMA RIFF headers.
FindLoc OFFSET string \x1\x66 0 ""
if OFFSET == ""
print "Error: No XMA file. Please send this file to AlphaTwentyThree at XeNTaX!"
cleanexit
endif
endian big
goto OFFSET
get CODE short
get CH short
get FREQ long
math OFFSET += 0x34
get SIZE asize
math SIZE -= OFFSET
math SIZE -= 0x10
get NAME basename
string NAME += "@"
string NAME += FREQ
if CH == 1
string NAME += "m"
elif CH == 2
string NAME += "s"
endif
string NAME += ".uxma"
log NAME OFFSET SIZE
Last edited by AlphaTwentyThree on Tue Oct 18, 2011 7:04 pm, edited 3 times in total.
The above script didn't work right in some cases so I changed it. Also added the mono/stereo option to the script AND to the addXMAheader.bms!
Also, when any script here doesn't work, please help me improve the scripts and upload the according file here.