Jump to content

DK Animation (.ani) - DK Children's Encyclopedia


Recommended Posts

Tried extracting audio from "DK Children's Encyclopedia 1.1" using this article - https://wiki.multimedia.cx/index.php/DK_Animation

Up until "frames per second" section it was the same in the header (except that number of chunks is actually higher by 10 than stated at the 0x02 offset), but all the rest of it turned out to be data for RIFF-WAVE header. And since this game uses Microsoft IMA ADPCM ("0x02" at 0x08 offset - for PCM it would be "0x01" as in the article), the header was prolonged up to 0x3F offset. The following chunks data have the same structure as in the article.

The problem is, the current format uses blockalign that is incompatible for just putting audiochunks next to each other - the alignment is 0x200, the audiochunks size is 0x8BB bytes.

At the moment the best I could do is to fill in the rest of aligned incomplete block with zeroes using the code below - at least wav works but has lots of unneeded spaces. Don't know if it's possible to do it much more reasonable than this.

A couple of examples is attached to this post. 

get NAME basename
get DUMMY short
get CHUNKS short
math CHUNKS += 10
getdstring DUMMY 0x6
get WAVHEADERSIZE long
savepos WAVHEADEROFFSET
get WAVEFORMATTAG short
get CH short
get KHZ long
get AVG long
get BLOCKALIGN short
goto WAVHEADEROFFSET
getdstring SKIP WAVHEADERSIZE


	log MEMORY_FILE2 0 0
	putct "RIFF" string -1 MEMORY_FILE2
	put 0x00000000 long MEMORY_FILE2
	putct "WAVEfmt " string -1 MEMORY_FILE2
	put WAVHEADERSIZE long MEMORY_FILE2

	append
	log MEMORY_FILE2 WAVHEADEROFFSET WAVHEADERSIZE
	append

	if WAVEFORMATTAG != 1
		putct "fact" string -1 MEMORY_FILE2
		put 4 long MEMORY_FILE2
		put 0x00000000 long MEMORY_FILE2
	endif
	putct "data" string -1 MEMORY_FILE2




log MEMORY_FILE 0 0
math SIZE = 0

for i = 0 < CHUNKS
get WHATEVS short
get AUDIOSIZE long
get VIDEOUPDRECT longlong
get VIDEOSIZE long
get ZVIDEOSIZE long
getdstring FUNKY 0x6
savepos AUDIOOFFSET

append
log MEMORY_FILE AUDIOOFFSET AUDIOSIZE
append

xmath AUDIOWITHPAD "AUDIOSIZE && BLOCKALIGN"
#print %AUDIOWITHPAD%
math SIZE += AUDIOWITHPAD
xmath PADZEROS "AUDIOWITHPAD - AUDIOSIZE"

for j = 0 < PADZEROS
put 0 byte MEMORY_FILE
next j

math AUDIOOFFSET += AUDIOSIZE
math AUDIOOFFSET += ZVIDEOSIZE
goto AUDIOOFFSET

next i


put SIZE long MEMORY_FILE2
append
log MEMORY_FILE2 0 SIZE MEMORY_FILE
append

get FULLSIZE asize MEMORY_FILE2
math RIFFSIZE = FULLSIZE
math RIFFSIZE -= 8
putVarChr MEMORY_FILE2 0x4 RIFFSIZE long

if WAVEFORMATTAG != 1
	putVarChr MEMORY_FILE2 0x4 RIFFSIZE long
endif


string NAME += ".wav"
log NAME 0 FULLSIZE MEMORY_FILE2

 

ani.rar

Edited by fignyafsyakaya
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...