Soundcache: Difference between revisions
TomEdwards (talk | contribs) m (→Outline) |
TomEdwards (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
==Outline== | ==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 | 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 finishes playing to begin streaming to hardware. Each soundcache has an accompanying .manifest, which contains a list of files needed by the map. | ||
==Extraction== | ==Extraction== | ||
Line 6: | Line 6: | ||
*.manifest files can be viewed with any text editor | *.manifest files can be viewed with any text editor | ||
==Creation== | ==Creation== | ||
Sound caches are created automatically if they do not already exist | Sound caches are created automatically if they do not already exist before a map is loaded. A manifest is first written listing every file used, then it ''appears'' to be compared against the <code>_sharedprecache</code> cache, and the first second of any files that are not in the shared cache are written to the map cache. | ||
*<code>snd_writemanifest</code> | *<code>snd_writemanifest</code> |
Revision as of 09:29, 26 November 2005
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 finishes 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 before a map is loaded. 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.