<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multimedia.cx/index.php?action=history&amp;feed=atom&amp;title=FutureVision_audio_formats</id>
	<title>FutureVision audio formats - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multimedia.cx/index.php?action=history&amp;feed=atom&amp;title=FutureVision_audio_formats"/>
	<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=FutureVision_audio_formats&amp;action=history"/>
	<updated>2026-06-10T05:21:07Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=FutureVision_audio_formats&amp;diff=7704&amp;oldid=prev</id>
		<title>DonDiego: Add to formats missing in FFmpeg category.</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=FutureVision_audio_formats&amp;diff=7704&amp;oldid=prev"/>
		<updated>2007-04-13T21:10:57Z</updated>

		<summary type="html">&lt;p&gt;Add to formats missing in FFmpeg category.&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 14:10, 13 April 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l212&quot;&gt;Line 212:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 212:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:ADPCM Audio Codecs]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:ADPCM Audio Codecs]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Game Formats]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Game Formats]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Formats missing in FFmpeg]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>DonDiego</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=FutureVision_audio_formats&amp;diff=5714&amp;oldid=prev</id>
		<title>Dashcloud: Adding FutureVision audio</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=FutureVision_audio_formats&amp;diff=5714&amp;oldid=prev"/>
		<updated>2006-08-16T15:59:41Z</updated>

		<summary type="html">&lt;p&gt;Adding FutureVision audio&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;*Extensions: CMP, FST, DAT&lt;br /&gt;
*Company: [[DigiFX]] (formerly [[FutureVision]])&lt;br /&gt;
&lt;br /&gt;
== Credit ==&lt;br /&gt;
The information on this page was originally based on one of the many format documents written up by Valery V. Anisimovsky, available on http://wotsit.org/ and many other sites across the internet.&lt;br /&gt;
&lt;br /&gt;
== Byte Order ==&lt;br /&gt;
All numbers are stored in little endian format.&lt;br /&gt;
&lt;br /&gt;
== CMP Audio Files ==&lt;br /&gt;
&lt;br /&gt;
The music/sfx/speech in Harvester are .CMP files (stand-alone or stored in&lt;br /&gt;
.DAT resources). CMP file has the following header:&lt;br /&gt;
&lt;br /&gt;
 struct CMPHeader&lt;br /&gt;
 {&lt;br /&gt;
  char	szID[4];&lt;br /&gt;
  DWORD dwDataSize;&lt;br /&gt;
  DWORD dwSampleRate;&lt;br /&gt;
  WORD	wBits;&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
''szID'' -- ID string, which is &amp;quot;FCMP&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
''dwDataSize'' -- the size of the data in the file. May be used for song length&lt;br /&gt;
(in seconds) calculation (taking into account the compression ratio).&lt;br /&gt;
CMP file size is the sum of the CMPHeader size and (dwDataSize).&lt;br /&gt;
&lt;br /&gt;
''dwSampleRate'' -- sample rate for the file.&lt;br /&gt;
&lt;br /&gt;
''wBits'' -- resolution of the file (8 (8-bit), 16 (16-bit), etc.).&lt;br /&gt;
&lt;br /&gt;
The channels number is NOT specified in the header, so the default value&lt;br /&gt;
(mono) should be used (all audio files in Harvester are mono).&lt;br /&gt;
&lt;br /&gt;
After the CMPHeader comes seemingly useless data. Its size is somewhat&lt;br /&gt;
uncertain, so you may define this as an option -- the good values for such an&lt;br /&gt;
option are 0x0 (no odd data), 0x4 and 0x37 bytes. The last value seems to be&lt;br /&gt;
the most adequate. After that odd junk of data comes IMA ADPCM compressed&lt;br /&gt;
sound data. You may find IMA ADPCM decompression scheme description further&lt;br /&gt;
in this document.&lt;br /&gt;
&lt;br /&gt;
=== End of file ===&lt;br /&gt;
Note that at the end of some CMP files there's a junk of seemingly garbage&lt;br /&gt;
data (usually 17 bytes) -- if you do not skip that when decompressing&lt;br /&gt;
IMA ADPCM stream you'll hear a considerable &amp;quot;popping&amp;quot; at the end of the&lt;br /&gt;
decompressed waveform.&lt;br /&gt;
&lt;br /&gt;
== IMA ADPCM Decompression Algorithm ==&lt;br /&gt;
&lt;br /&gt;
During the decompression two LONG variables must be maintained for mono&lt;br /&gt;
stream: ''lIndex, lCurSample''. At the beginning of the file you must initialize&lt;br /&gt;
them 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;
mono 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=LONIBBLE(Input); // get LOWER 4-bit nibble&lt;br /&gt;
 &lt;br /&gt;
 Delta=StepTable[lIndex]&amp;gt;&amp;gt;3;&lt;br /&gt;
 if (Code &amp;amp; 4)&lt;br /&gt;
   Delta+=StepTable[lIndex];&lt;br /&gt;
 if (Code &amp;amp; 2)&lt;br /&gt;
   Delta+=StepTable[lIndex]&amp;gt;&amp;gt;1;&lt;br /&gt;
 if (Code &amp;amp; 1)&lt;br /&gt;
   Delta+=StepTable[lIndex]&amp;gt;&amp;gt;2;&lt;br /&gt;
 if (Code &amp;amp; 8) // sign bit&lt;br /&gt;
   lCurSample-=Delta;&lt;br /&gt;
 else&lt;br /&gt;
   lCurSample+=Delta;&lt;br /&gt;
 &lt;br /&gt;
 // clip sample&lt;br /&gt;
 if (lCurSample&amp;gt;32767)&lt;br /&gt;
   lCurSample=32767;&lt;br /&gt;
 else if (lCurSample&amp;lt;-32768)&lt;br /&gt;
   lCurSample=-32768;&lt;br /&gt;
 &lt;br /&gt;
 lIndex+=IndexAdjust[Code]; // adjust index&lt;br /&gt;
 &lt;br /&gt;
 // clip index&lt;br /&gt;
 if (lIndex&amp;lt;0)&lt;br /&gt;
   lIndex=0;&lt;br /&gt;
 else if (lIndex&amp;gt;88)&lt;br /&gt;
   lIndex=88;&lt;br /&gt;
 &lt;br /&gt;
 Output((SHORT)lCurSample); // send the sample to output&lt;br /&gt;
 &lt;br /&gt;
 Code=HINIBBLE(Input); // get HIGHER 4-bit nibble&lt;br /&gt;
 // ...just the same as above for higher nibble&lt;br /&gt;
&lt;br /&gt;
HINIBBLE and LONIBBLE are higher and lower 4-bit nibbles:&lt;br /&gt;
 #define HINIBBLE(byte) ((byte) &amp;gt;&amp;gt; 4)&lt;br /&gt;
 #define LONIBBLE(byte) ((byte) &amp;amp; 0x0F)&lt;br /&gt;
Note that depending on your compiler you may need to use additional nibble&lt;br /&gt;
separation in these defines, e.g. ''(((byte) &amp;gt;&amp;gt; 4) &amp;amp; 0x0F)''.&lt;br /&gt;
&lt;br /&gt;
StepTable and IndexAdjust are the tables given in the next section of&lt;br /&gt;
this document.&lt;br /&gt;
&lt;br /&gt;
Output() is just a placeholder for any action you would like to perform for&lt;br /&gt;
decompressed sample value.&lt;br /&gt;
&lt;br /&gt;
Note that LOWER nibble is processed first for mono sound.&lt;br /&gt;
&lt;br /&gt;
Of course, this decompression routine may be greatly optimized.&lt;br /&gt;
&lt;br /&gt;
== IMA ADPCM Tables ==&lt;br /&gt;
&lt;br /&gt;
 LONG IndexAdjust[]=&lt;br /&gt;
 {&lt;br /&gt;
    -1,&lt;br /&gt;
    -1,&lt;br /&gt;
    -1,&lt;br /&gt;
    -1,&lt;br /&gt;
     2,&lt;br /&gt;
     4,&lt;br /&gt;
     6,&lt;br /&gt;
     8,&lt;br /&gt;
    -1,&lt;br /&gt;
    -1,&lt;br /&gt;
    -1,&lt;br /&gt;
    -1,&lt;br /&gt;
     2,&lt;br /&gt;
     4,&lt;br /&gt;
     6,&lt;br /&gt;
     8&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 LONG StepTable[]=&lt;br /&gt;
 {&lt;br /&gt;
    7,	   8,	  9,	 10,	11,    12,     13,    14,    16,&lt;br /&gt;
    17,    19,	  21,	 23,	25,    28,     31,    34,    37,&lt;br /&gt;
    41,    45,	  50,	 55,	60,    66,     73,    80,    88,&lt;br /&gt;
    97,    107,   118,	 130,	143,   157,    173,   190,   209,&lt;br /&gt;
    230,   253,   279,	 307,	337,   371,    408,   449,   494,&lt;br /&gt;
    544,   598,   658,	 724,	796,   876,    963,   1060,  1166,&lt;br /&gt;
    1282,  1411,  1552,  1707,	1878,  2066,   2272,  2499,  2749,&lt;br /&gt;
    3024,  3327,  3660,  4026,	4428,  4871,   5358,  5894,  6484,&lt;br /&gt;
    7132,  7845,  8630,  9493,	10442, 11487,  12635, 13899, 15289,&lt;br /&gt;
    16818, 18500, 20350, 22385, 24623, 27086,  29794, 32767&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
== FST Movie Soundtrack ==&lt;br /&gt;
&lt;br /&gt;
.FST files are movies used in Harvester.&lt;br /&gt;
FST file has the following header:&lt;br /&gt;
&lt;br /&gt;
 struct FSTHeader&lt;br /&gt;
 {&lt;br /&gt;
  char	szID[4];&lt;br /&gt;
  DWORD dwImageWidth;&lt;br /&gt;
  DWORD dwImageHeight;&lt;br /&gt;
  DWORD dwUnknown1;&lt;br /&gt;
  DWORD dwNumFrames;&lt;br /&gt;
  DWORD dwFrameRate;&lt;br /&gt;
  DWORD dwSampleRate;&lt;br /&gt;
  WORD	wBits;&lt;br /&gt;
  WORD	wUnknown2;&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
''szID'' -- ID string, which is &amp;quot;2TSF&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
''dwNumFrames'' -- number of frames in FST.&lt;br /&gt;
&lt;br /&gt;
''dwSampleRate'' -- sample rate for the file.&lt;br /&gt;
&lt;br /&gt;
''wBits'' -- resolution of the file (8 (8-bit), 16 (16-bit), etc.).&lt;br /&gt;
&lt;br /&gt;
After the FSTHeader comes the table of frame entries. It contains&lt;br /&gt;
(''dwNumFrames'') entries of the following format:&lt;br /&gt;
&lt;br /&gt;
 struct FSTFrameEntry&lt;br /&gt;
 {&lt;br /&gt;
  DWORD dwImageSize;&lt;br /&gt;
  WORD	wSoundSize;&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
After the table of frame entries comes the frame data. Each frame chunk&lt;br /&gt;
contains image data which has the size (''dwImageSize'') bytes, and the sound&lt;br /&gt;
data which has the size (''wSoundSize'') bytes -- these values are taken from the&lt;br /&gt;
frame entry correspondent to the given frame. Sound data immediately follows&lt;br /&gt;
the image data. Sound data in Harvester movies is non-compressed signed&lt;br /&gt;
16-bit [[PCM]] data.&lt;br /&gt;
&lt;br /&gt;
Note that the sound part in the first frame chunk contains data for several&lt;br /&gt;
frames (not only for the first frame). Thus you should skip the sound parts&lt;br /&gt;
of several last frame chunks. Namely, the good estimation for the number of&lt;br /&gt;
frame chunks to skip is the number of frames covered by sound data in the&lt;br /&gt;
first frame chunk minus one. That is, you may take the frame entry for the&lt;br /&gt;
first frame, devide its (''wSoundSize'') by the correspondent value for the&lt;br /&gt;
second frame and subtract one from the result -- that'll give the number of&lt;br /&gt;
frame chunks to skip (the last chunks, of course).&lt;br /&gt;
&lt;br /&gt;
== CMP Audio Files in DAT Archives ==&lt;br /&gt;
&lt;br /&gt;
When stored in .DAT resources, CMP audio files are stored &amp;quot;as is&amp;quot;, without&lt;br /&gt;
compression or encryption. That means if you want to play/extract CMP&lt;br /&gt;
file from the DAT resource you just need to search for (''szID'') id-string&lt;br /&gt;
(&amp;quot;FCMP&amp;quot;) and read CMP header starting at the beginning position of&lt;br /&gt;
found id-string. This will give you starting point of the file and the size&lt;br /&gt;
of the file will be the sum of CMPHeader size and (''dwDataSize'') header field.&lt;br /&gt;
&lt;br /&gt;
==PC Games Using FutureVision audio==&lt;br /&gt;
[http://www.mobygames.com/game/dos/harvester Harvester]&lt;br /&gt;
&lt;br /&gt;
[[Category:Audio Codecs]]&lt;br /&gt;
[[Category:ADPCM Audio Codecs]]&lt;br /&gt;
[[Category:Game Formats]]&lt;/div&gt;</summary>
		<author><name>Dashcloud</name></author>
	</entry>
</feed>