Does anybody know if there is a tool or script to convert RIFX files to RIFF? Not all codecs regarded, only the standard PCM and ADPCM ones (PCM, MS_ADPCM, IMA_ADPCM). If you need samples, here are some for MS_ADPCM: http://upfile.mobi/655416 Thanks for your help!
As far as I can see the only difference with a normal RIFF is the endianess. Exists a very basic way to do this job with quickbms, basically all you need to create is a script that parses the format (no extraction), then use "quickbms -w -E script.bms backup_file.lwav" and backup_file will contain all the fields in reverse endian.
The following is a script able to read any RIFF and RIFX with automatic endian guessing, if you use it with -E it will auotmatically reverse the endianess.
idstring "RIF" get TYPE byte get SIZE long endian guess SIZE idstring "WAVE" get RIFF_SIZE asize savepos NEXT_OFF for NEXT_OFF = NEXT_OFF < RIFF_SIZE getdstring CHUNK_TYPE 4 get CHUNK_SIZE long
if CHUNK_TYPE == "fmt " get wFormatTag short get wChannels short get dwSamplesPerSec long get dwAvgBytesPerSec long get wBlockAlign short get wBitsPerSample short
savepos TMP for TMP = TMP < NEXT_OFF get DUMMY short next TMP += 2
elif CHUNK_TYPE == "akd " getdstring DUMMY 0x10
savepos TMP for TMP = TMP < NEXT_OFF get DUMMY short next TMP += 2
elif CHUNK_TYPE == "data" if wFormatTag == 1 savepos TMP for TMP = TMP < NEXT_OFF for c = 0 < wChannels if wBitsPerSample == 8 get SAMPLE byte elif wBitsPerSample == 16 get SAMPLE short elif wBitsPerSample == 32 get SAMPLE long endif next c savepos TMP next endif
Wait it's ok, everything went fine. However, the file doesn't produce any usable result. Is there a way to change the interleave value? Running the file through ima_rejigger didn't help either.