<?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=Bodhost</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=Bodhost"/>
	<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php/Special:Contributions/Bodhost"/>
	<updated>2026-05-07T08:00:09Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=CLU&amp;diff=6933</id>
		<title>CLU</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=CLU&amp;diff=6933"/>
		<updated>2007-02-03T01:19:07Z</updated>

		<summary type="html">&lt;p&gt;Bodhost: /* PC Games using CLU format */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Extension: clu&lt;br /&gt;
* Company: [[Revolution Studios]]&lt;br /&gt;
&lt;br /&gt;
== Credit ==&lt;br /&gt;
The information on this page is based on a document found on http://wotsit.org/ and other sites on the internet, and originated on [[GAP]]'s (Game Audio Player) website (now defunct). The information was originally by Valery V. Anisimovsky (no valid email address known)&lt;br /&gt;
&lt;br /&gt;
== CLU Resource Files==&lt;br /&gt;
All numbers in all structures described are stored in files using little-endian (Intel) byte order.&lt;br /&gt;
&lt;br /&gt;
Music/speech/sound files of Broken Sword 2 are stored in CLU resource&lt;br /&gt;
files. Each music/speech/sound CLU file has the following header:&lt;br /&gt;
&lt;br /&gt;
 struct tagCLUHeader&lt;br /&gt;
 {&lt;br /&gt;
  DWORD dwNumber;&lt;br /&gt;
  char	szID[4];&lt;br /&gt;
 } CLUHeader;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''szID'' -- string ID is always &amp;quot;\xFF\xF0\xFF\xF0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
''dwNumber'' -- the number of files stored in CLU file.&lt;br /&gt;
&lt;br /&gt;
After the header comes the array of (''dwNumber'') directory entries.&lt;br /&gt;
Each directory entry contains the info on a file in CLU archive. Each such&lt;br /&gt;
entry has the following format:&lt;br /&gt;
&lt;br /&gt;
 struct tagCLUDirEntry&lt;br /&gt;
 {&lt;br /&gt;
  DWORD dwStart;&lt;br /&gt;
  DWORD dwSize;&lt;br /&gt;
 } CLUDirEntry;&lt;br /&gt;
&lt;br /&gt;
''dwStart'' -- the starting position of the file relative to the beginning of the&lt;br /&gt;
CLU archive.&lt;br /&gt;
&lt;br /&gt;
''dwSize'' -- the size of the file.&lt;br /&gt;
&lt;br /&gt;
Note that there're some entries with zero (''dwStart'') or (''dwSize'') --&lt;br /&gt;
they correspond to the files absent in the given CLU archive (the files&lt;br /&gt;
with the same numbers may be found in the corresponding CLU archive on&lt;br /&gt;
the other game CD).&lt;br /&gt;
&lt;br /&gt;
After the array of directory entries come the files contained in CLU&lt;br /&gt;
archive.&lt;br /&gt;
&lt;br /&gt;
NOTE: The CLU files containing other types of game data have different&lt;br /&gt;
format. It's not described here.&lt;br /&gt;
&lt;br /&gt;
== CLUSFX Music/Speech/Sound Files ==&lt;br /&gt;
All of the music/speech/sfx files are of the same format which is referred to here as CLUSFX. A CLUSFX file has a simple format -- just a 16-bit initial predictor value followed by a compressed waveform stream. When decompressed, all music/speech/sfx files are 16-bit mono [[PCM]] samples replayed at 22050 Hz. ''(signed or unsigned? presumably signed --[[User:Multimedia Mike|Multimedia Mike]])''&lt;br /&gt;
&lt;br /&gt;
All CLUSFX files are compressed using CLU ADPCM compression algorithm.&lt;br /&gt;
&lt;br /&gt;
== CLU ADPCM Decompression Algorithm==&lt;br /&gt;
A CLU file begins with a 16-bit initial predictor value that is not sent to the output. The compressed stream is comprised of a sequence of bytes. The 8 bits of each byte have the following meaning:&lt;br /&gt;
&lt;br /&gt;
  bits 7-4    delta magnifier&lt;br /&gt;
  bit 3       sign bit&lt;br /&gt;
  bits 2-0    delta base&lt;br /&gt;
&lt;br /&gt;
For each byte:&lt;br /&gt;
  delta = (delta base) &amp;lt;&amp;lt; (delta magnifier)&lt;br /&gt;
  if the sign bit is cleared&lt;br /&gt;
    predictor += delta&lt;br /&gt;
  else&lt;br /&gt;
    predictor -= delta&lt;br /&gt;
  send predictor to the output as the next audio sample&lt;br /&gt;
&lt;br /&gt;
Presumably, the output sample should be saturated within an appropriate value range.&lt;br /&gt;
&lt;br /&gt;
== PC Games using CLU format ==&lt;br /&gt;
*[http://bodhost.com/web-hosting/index.php/2006/11/09/clu/ CLU Historic Basics]&lt;br /&gt;
*[http://www.mobygames.com/game/windows/broken-sword-the-smoking-mirror Broken Sword 2: The Smoking Mirror]&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>Bodhost</name></author>
	</entry>
</feed>