The following script tries to make a GENH out of a RIFX file. It's a crude script but it does the job so far. But as I mentioned, something is wrong with the coefficients. First of all, here are some RIFX dsp samples: http://www102.zippyshare.com/v/eTHlP6tw/file.html
I suspect the coefficients to be at 0x80 and 0xaa but I could be wrong.
Here's the script for the GENH:
Code: Select all
idstring "RIFX"
endian big
set OFFSET 0xe0
goto 0x16
get CH short
get FREQ long
goto 0x2c
get NOS long
set OFF_COEFF1 0x80
set OFF_COEFF2 0xaa
get SIZE asize
math SIZE -= OFFSET
xmath PRE_SIZE "SIZE + 0xc0"
putVarChr MEMORY_FILE SIZE 0
log MEMORY_FILE 0 0
endian little
putVarChr MEMORY_FILE 0 0x484e4547 long # "GENH"
putVarChr MEMORY_FILE 4 CH long # ch
putVarChr MEMORY_FILE 8 8 long # interleave
putVarChr MEMORY_FILE 0xc FREQ long
putVarChr MEMORY_FILE 0x10 0xffffffff long
putVarChr MEMORY_FILE 0x14 NOS long # number of samples
putVarChr MEMORY_FILE 0x18 0xc long # ?
putVarChr MEMORY_FILE 0x1c 0xc0 long # stream start
putVarChr MEMORY_FILE 0x20 0xc0 long # stream start
putVarChr MEMORY_FILE 0x24 0x80 long # coeff1
putVarChr MEMORY_FILE 0x28 0xa0 long # coeff2
putVarChr MEMORY_FILE 0x2c 1 long
putVarChr MEMORY_FILE 0x34 0x80 long # coeff1
putVarChr MEMORY_FILE 0x38 0xa0 long # coeff2
putVarChr MEMORY_FILE 0x7f 0 byte
append
log MEMORY_FILE OFF_COEFF1 0x20
log MEMORY_FILE OFF_COEFF2 0x20
log MEMORY_FILE OFFSET SIZE
append
get SIZE asize MEMORY_FILE
get NAME basename
string NAME += ".genh"
log NAME 0 SIZE MEMORY_FILE
Any help is appreciated!