<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multimedia.cx/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MlzIy5</id>
	<title>MultimediaWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multimedia.cx/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MlzIy5"/>
	<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php/Special:Contributions/MlzIy5"/>
	<updated>2026-07-13T07:43:07Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=CRYO_APC&amp;diff=7612</id>
		<title>CRYO APC</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=CRYO_APC&amp;diff=7612"/>
		<updated>2007-04-10T19:01:57Z</updated>

		<summary type="html">&lt;p&gt;MlzIy5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Extensions: .APC, .HNM, .BF, .ZIK&lt;br /&gt;
* Company: [[CRYO Interactive Entertainment]]&lt;br /&gt;
&lt;br /&gt;
This covers the audio format for one of the versions of CRYO's video formats.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Credit==&lt;br /&gt;
This file comes from [http://www.wotsit.org wotsit.org] and was originally written by Valery V. Anisimovsky.&lt;br /&gt;
&lt;br /&gt;
== APC Audio Files==&lt;br /&gt;
&lt;br /&gt;
The music, sfx, speech and video (.HNM) soundtracks in some CRYO Interactive&lt;br /&gt;
games are .APC stand-alone files. APC file has the following header:&lt;br /&gt;
&lt;br /&gt;
 struct APCHeader&lt;br /&gt;
 {&lt;br /&gt;
  char	szID[8];&lt;br /&gt;
  char	szVersion[4];&lt;br /&gt;
  DWORD dwOutSize;&lt;br /&gt;
  DWORD dwSampleRate;&lt;br /&gt;
  LONG	lSampleLeft;&lt;br /&gt;
  LONG	lSampleRight;&lt;br /&gt;
  DWORD dwStereo;&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
''szID'' -- ID string, which is &amp;quot;CRYO_APC&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
''szVersion'' -- version ID string, all files in the mentioned games have this&lt;br /&gt;
set to &amp;quot;1.20&amp;quot;. Note that this field may, in principle, vary.&lt;br /&gt;
&lt;br /&gt;
''dwOutSize'' -- number of samples in the file. May be used for song length&lt;br /&gt;
(in seconds) calculation.&lt;br /&gt;
&lt;br /&gt;
''dwSampleRate'' -- sample rate for the file.&lt;br /&gt;
&lt;br /&gt;
''lSampleLeft'' -- the initial value for the left sample (see below).&lt;br /&gt;
&lt;br /&gt;
''lSampleRight'' -- the initial value for the right sample (see below).&lt;br /&gt;
&lt;br /&gt;
''dwStereo'' -- this seems to be boolean stereo flag: if this is not zero, the&lt;br /&gt;
audio stream in the file is stereo (music and partly video soundtracks),&lt;br /&gt;
otherwise it's mono (sfx, speech).&lt;br /&gt;
&lt;br /&gt;
The resolution is NOT specified in the header, so the default value (16-bit)&lt;br /&gt;
should be used.&lt;br /&gt;
&lt;br /&gt;
After the APCHeader IMA ADPCM compressed sound data comes. You may find&lt;br /&gt;
IMA ADPCM decompression scheme description further in this document.&lt;br /&gt;
&lt;br /&gt;
== IMA ADPCM Decompression Algorithm ==&lt;br /&gt;
&lt;br /&gt;
During the decompression four LONG variables must be maintained for stereo&lt;br /&gt;
stream: ''lIndexLeft, lIndexRight, lCurSampleLeft, lCurSampleRight'' and two --&lt;br /&gt;
for mono stream: ''lIndex, lCurSample''. At the beginning of the file you must&lt;br /&gt;
initialize ''lCurSampleLeft/Right'' variables to the values from APCHeader while&lt;br /&gt;
''lIndexLeft/Right'' are initialized to zeroes.&lt;br /&gt;
Note that LONG here is signed.&lt;br /&gt;
&lt;br /&gt;
Here's the code which decompresses one byte of IMA ADPCM compressed&lt;br /&gt;
stereo stream. Other bytes are processed in the same way.&lt;br /&gt;
&lt;br /&gt;
 BYTE Input; // current byte of compressed data&lt;br /&gt;
 BYTE Code;&lt;br /&gt;
 LONG Delta;&lt;br /&gt;
 &lt;br /&gt;
 Code=HINIBBLE(Input); // get HIGHER 4-bit nibble&lt;br /&gt;
 &lt;br /&gt;
 Delta=StepTable[lIndexLeft]&amp;gt;&amp;gt;3;&lt;br /&gt;
 if (Code&lt;/div&gt;</summary>
		<author><name>MlzIy5</name></author>
	</entry>
</feed>