Soundcache

From Valve Developer Community
Revision as of 09:29, 26 November 2005 by TomEdwards (talk | contribs) (→‎Outline)
Jump to navigation Jump to search

Outline

A Soundcache is a file with contains the first second of each sound required in a map. Source loads the soundcache instead of the sounds themselves to save time and memory: during gameplay the soundcache snippet is played while the full sound loads on-demand from the hard drive. There is enough data loaded by the time the sound snippet finished playing to begin streaming to hardware. Each soundcache has an accompanying .manifest, which contains a list of files needed by the map.

Extraction

  • .cache files can be viewed with Game Extractor [1]
  • .manifest files can be viewed with any text editor

Creation

Sound caches are created automatically if they do not already exist when you disconnect from a map. A manifest is first written listing every file used, then it appears to be compared against the _sharedprecache cache, and the first second of any files that are not in the shared cache are written to the map cache.

  • snd_writemanifest
Writes the .manifest file. Buggy.
  • snd_rebuildaudiocache
Writes the .cache file, containing soundfile snippets. Untested.

Limitations & Bugs

Soundcaches are very buggy. Each cache and manifest, whether generated from your own work or shipped with Half-Life 2, will contain many sound files that are not needed, and won't contain many that are. There is no known solution at this time.