Sound Asset: Difference between revisions

From COD Engine Research
No edit summary
 
(5 intermediate revisions by 3 users not shown)
Line 10: Line 10:
== Infinity Ward ==
== Infinity Ward ==
<source lang="cpp">
<source lang="cpp">
struct SpeakerMapChannelEntry
struct SpeakerLevels
{
{
int InputChannel;
  int speaker;
int OutputChannel;
  int numLevels;
float CurrentVolume;
  float levels[2];
float TargetVolume;
};
};


struct SpeakerMapChannel
struct ChannelMap
{
{
int entryCount; // how many entries are used
  int entryCount; // how many entries are used
SpeakerMapChannelEntry entries[6];
  SpeakerLevels speakers6];
};
};


struct SpeakerMap
struct SpeakerMap
{
{
bool isDefault;
  bool isDefault;
const char *name;
  const char *name;
SpeakerMapChannel channelMaps[2][2];
  ChannelMap channelMaps[2][2];
};
};


Line 38: Line 37:
SAT_PRIMED = 0x3,
SAT_PRIMED = 0x3,
SAT_COUNT = 0x4,
SAT_COUNT = 0x4,
};
struct StreamFileNamePacked
{
  unsigned __int64 offset;
  unsigned __int64 length;
};
struct StreamFileNameRaw
{
  const char *dir;
  const char *name;
};
union StreamFileInfo
{
  StreamFileNameRaw raw;
  StreamFileNamePacked packed;
};
struct StreamFileName
{
  unsigned __int16 isLocalized;
  unsigned __int16 fileIndex;
  StreamFileInfo info;
};
};


struct StreamedSound
struct StreamedSound
{
{
int packfileNum;
  StreamFileName filename;
union
  unsigned int totalMsec;
{
};
const char *strings[2]; // if packfileNum == 0
 
struct
struct PrimedSound
{
{
int soundOffset;
  StreamFileName filename;
int soundSize;
  LoadedSound *loadedPart;
};
  int dataOffset;
};
  int totalSize;
  unsigned int primedCrc;
};
};


union SoundData
union SoundData
{
{
LoadedSound *loadSnd; // SoundFile->type == SAT_LOADED
  LoadedSound *loadSnd; // SoundFile->type == SAT_LOADED
StreamedSound streamSnd; // SoundFile->type == SAT_STREAMED
  StreamedSound streamSnd; // SoundFile->type == SAT_STREAMED
  PrimedSound primedSnd; // SoundFile->type == SAT_PRIMED
};
};


Line 64: Line 90:
snd_alias_type_t type;
snd_alias_type_t type;
bool exists;
bool exists;
SoundData sound;
SoundFileRef sound;
};
};


struct snd_alias_t
struct snd_alias_t
{
{
const char *aliasName;
  const char *aliasName;
const char *subtitle;
  const char *subtitle;
const char *secondaryAliasName;
  const char *secondaryAliasName;
const char *chainAliasName;
  const char *chainAliasName;
#ifndef COD4
#ifndef COD4
const char *devSoundMixerGroup;
  const char *mixerGroup;
#endif
#endif
SoundFile *soundFile;
  SoundFile *soundFile;
int sequence;
  int sequence;
float volMin;
  float volMin;
float volMax;
  float volMax;
#ifdef MW3 || GHOSTS
#if defined(MW3) || defined(GHOSTS)
short volMod;
  int volModIndex;
#endif
#endif
float pitchMin;
  float pitchMin;
float pitchMax;
  float pitchMax;
float distMin;
  float distMin;
float distMax;
  float distMax;
#ifndef COD4
#ifndef COD4
float velocityMin;
  float velocityMin;
#endif
#endif
int flags;
  int flags;
#ifdef MW3 || GHOSTS
#if defined(MW3) || defined(GHOSTS)
char masterPriority;
  char masterPriority;
float masterPercentage;
  float masterPercentage;
#endif
#endif
float slavePercentage;
  float slavePercentage;
float probability;
  float probability;
float lfePercentage;
  float lfePercentage;
float centerPercentage;
  float centerPercentage;
int startDelay;
  int startDelay;
SndCurve *volumeFalloffCurve;
  SndCurve *volumeFalloffCurve;
#ifdef GHOSTS
#ifdef GHOSTS
LPFCurve *unknownLPFCurve;
  SndCurve *lpfCurve;
ReverbSendCurve *unknownReverbSendCurve;
  SndCurve *reverbSendCurve;
#endif
#endif
float envelopMin;
  float envelopMin;
float envelopMax;
  float envelopMax;
float envelopPercentage;
  float envelopPercentage;
SpeakerMap *speakerMap;
  SpeakerMap *speakerMap;
#ifdef GHOSTS
#ifdef GHOSTS
int unknown3;
  float wetMixOverride;
char (*unknown4)[0x18];
  OcclusionShape *occlusionShape;
int unknown5;
  char allowDoppler;
DopplerPreset *unknownDopplerPreset;
  DopplerPreset *dopplerPreset;
#endif
#endif
};
};
Line 119: Line 145:
struct snd_alias_list_t
struct snd_alias_list_t
{
{
const char *aliasName;
  const char *aliasName;
snd_alias_t *head;
  snd_alias_t *head;
int count;
  int count;
};
};
</source>
</source>
Line 130: Line 156:
const char *unknownString;
const char *unknownString;
const char *buffer;
const char *buffer;
int unknown;
int size;
};
};


Line 137: Line 163:
struct
struct
{
{
int unknown;
unsigned int hash;
const char *unknownStrings[2];
const char *dir;
const char *name;
};
};
PrimedSound *primedSnd;
PrimedSound *primedSnd;
};
};


union SoundFileRef
{
LoadedSound *loadSnd;
StreamedSound streamSnd;
};
struct SoundFile
struct SoundFile
{
{
snd_alias_type_t type;
snd_alias_type_t type;
bool exists;
bool exists;
union
SoundFileRef u;
{
StreamedSound streamSnd;
LoadedSound *loadSnd;
} u;
};
};


Line 211: Line 239:
};
};
</source>
</source>
== Black Ops ==
== Black Ops ==
<source lang="cpp">
<source lang="cpp">
struct SndRadverb
struct SndIndexEntry
{
  unsigned __int16 value;
  unsigned __int16 next;
};
 
struct snd_radverb
{
{
char name[0x20];
  char name[32];
int nameHash;
  unsigned int id;
float smoothing;
  float smoothing;
float earlyTime;
  float earlyTime;
float lateTime;
  float lateTime;
float earlyGain;
  float earlyGain;
float lateGain;
  float lateGain;
float returnGain;
  float returnGain;
float earlyLpf;
  float earlyLpf;
float lateLpf;
  float lateLpf;
float inputLpf;
  float inputLpf;
float dampLpf;
  float dampLpf;
float wallReflect;
  float wallReflect;
float dryGain;
  float dryGain;
float earlySize;
  float earlySize;
float lateSize;
  float lateSize;
float diffusion;
  float diffusion;
};
};


struct SndSnapshot
struct snd_snapshot
{
{
char name[0x20];
  char name[32];
int nameHash;
  unsigned int id;
char occlusion[0x20];
  char occlusionName[32];
int occlusionHash;
  unsigned int occlusionId;
int fadeIn;
  float fadeIn;
int fadeOut;
  float fadeOut;
int distance;
  float distance;
int fadeInCurve;
  unsigned int fadeInCurve;
int fadeOutCurve;
  unsigned int fadeOutCurve;
float field_5C[64];
  float attenuation[64];
};
};


struct snd_alias_t
struct snd_alias_t
{
{
const char *aliasName;
  const char *name;
int subtitle;
  unsigned int id;
const char *secondaryAliasName;
  const char *subtitle;
const char *chainAliasName;
  const char *secondaryname;
SoundFile *soundFile;
  SoundFile *soundFile;
int flags;
  unsigned int flags;
int duck;
  unsigned int duck;
int contextType;
  unsigned int contextType;
int contextValue;
  unsigned int contextValue;
short moveTime;
  unsigned __int16 fluxTime;
short startDelay;
  unsigned __int16 startDelay;
short centerSend;
  unsigned __int16 reverbSend;
short reverbSend;
  unsigned __int16 centerSend;
short volMin;
  unsigned __int16 volMin;
short volMax;
  unsigned __int16 volMax;
short teamVolMod;
  unsigned __int16 teamVolMod;
short pitchMin;
  unsigned __int16 pitchMin;
short pitchMax;
  unsigned __int16 pitchMax;
short teamPitchMod;
  unsigned __int16 teamPitchMod;
short distMin;
  unsigned __int16 distMin;
short distMax;
  unsigned __int16 distMax;
short distReverbMax;
  unsigned __int16 distReverbMax;
short envelopMin;
  unsigned __int16 envelopMin;
short envelopMax;
  unsigned __int16 envelopMax;
short envelopPercentage;
  unsigned __int16 envelopPercentage;
char minPriorityThreshold;
  char minPriorityThreshold;
char maxPriorityThreshold;
  char maxPriorityThreshold;
char probability;
  char probability;
char occlusionLevel;
  char occlusionLevel;
char occlusionWetDry;
  char occlusionWetDry;
char minPriority;
  char minPriority;
char maxPriority;
  char maxPriority;
char pan;
  char pan;
char volumeFalloffCurve;
  char dryCurve;
char reverbFalloffCurve;
  char wetCurve;
char volumeMinFalloffCurve;
  char dryMinCurve;
char reverbMinFalloffCurve;
  char wetMinCurve;
char limitCount;
  char limitCount;
char entityLimitCount;
  char entityLimitCount;
char snapshot;
  char snapshotGroup;
};
};


struct SndBank
struct SndBank
{
{
int name;
  const char *name;
int aliasCount;
  unsigned int aliasCount;
snd_alias_list_t *alias;
  snd_alias_list_t *alias;
int *aliasIndex;
  SndIndexEntry *aliasIndex;
int unknown[2];
  unsigned int packHash;
int numRadverbs;
  unsigned int packLocation;
SndRadverb *radverbs;
  unsigned int radverbCount;
int numSnapshots;
  snd_radverb *radverbs;
SndSnapshot *snapshots;
  unsigned int snapshotCount;
  snd_snapshot *snapshots;
};
};
</source>
</source>
== Black Ops 2 ==
== Black Ops 2 ==
<source lang="cpp">
<source lang="cpp">
struct SndStruct5 // 0x1C
enum SndBankState
{
{
const char *string1;
  SND_BANK_STATE_NEW = 0x0,
const char *string2;
  SND_BANK_STATE_STREAM_HEADER = 0x1,
int unknown1;
  SND_BANK_STATE_STREAM_TOC = 0x2,
int count1;
  SND_BANK_STATE_LOADED_HEADER = 0x3,
char *unk1; // size = 0x14 * count1
  SND_BANK_STATE_LOADED_TOC = 0x4,
int count2;
  SND_BANK_STATE_LOADED_ASSET_WAIT = 0x5,
char *unk2; // count = count2
  SND_BANK_STATE_LOADED_ASSETS = 0x6,
  SND_BANK_STATE_READY_TO_USE = 0x7,
  SND_BANK_STATE_ERROR = 0x8,
};
};


struct SndStruct4 // 0x922
struct SndAssetBankEntry
{
{
const char *string1;
  unsigned int id;
const char *string2;
  unsigned int size;
char unknown[0x91A];
  unsigned int offset;
  unsigned int frameCount;
  char frameRateIndex;
  char channelCount;
  char looping;
  char format;
};
 
struct SndLoadedAssets // 0x1C
{
  const char *zone;
  const char *language;
  unsigned int loadedCount;
  unsigned int entryCount;
  SndAssetBankEntry *entries;
  unsigned int dataSize;
  char *data;
};
};


struct SndDuck // 0x4C
struct SndDuck // 0x4C
{
{
char name[0x20];
  char name[32];
int nameHash;
  unsigned int id;
float fadeIn;
  float fadeIn;
float fadeOut;
  float fadeOut;
float startDelay;
  float startDelay;
float distance;
  float distance;
float length;
  float length;
int fadeInCurve;
  unsigned int fadeInCurve;
int fadeOutCurve;
  unsigned int fadeOutCurve;
float *attenuation; // size = 0x80
  float (*attenuation)[0x80];
float *lpf; // size = 0x80
  float (*filter)[0x80];
int updateWhilePaused;
  int updateWhilePaused;
};
 
struct SndAlias
{
  const char *name;
  unsigned int id;
  const char *subtitle;
  const char *secondaryname;
  unsigned int assetId;
  const char *assetFileName;
  unsigned int flags0;
  unsigned int flags1;
  unsigned int duck;
  unsigned int contextType;
  unsigned int contextValue;
  unsigned int stopOnPlay;
  unsigned int futzPatch;
  unsigned __int16 fluxTime;
  unsigned __int16 startDelay;
  unsigned __int16 reverbSend;
  unsigned __int16 centerSend;
  unsigned __int16 volMin;
  unsigned __int16 volMax;
  unsigned __int16 pitchMin;
  unsigned __int16 pitchMax;
  unsigned __int16 distMin;
  unsigned __int16 distMax;
  unsigned __int16 distReverbMax;
  unsigned __int16 envelopMin;
  unsigned __int16 envelopMax;
  unsigned __int16 envelopPercentage;
  __int16 fadeIn;
  __int16 fadeOut;
  __int16 dopplerScale;
  char minPriorityThreshold;
  char maxPriorityThreshold;
  char probability;
  char occlusionLevel;
  char minPriority;
  char maxPriority;
  char pan;
  char limitCount;
  char entityLimitCount;
  char duckGroup;
};
 
struct SndAliasList // 0x14
{
  const char *name;
  unsigned int id;
  SndAlias *head;
  int count;
  int sequence;
};
 
struct SndRadverb
{
  char name[32];
  unsigned int id;
  float smoothing;
  float earlyTime;
  float lateTime;
  float earlyGain;
  float lateGain;
  float returnGain;
  float earlyLpf;
  float lateLpf;
  float inputLpf;
  float dampLpf;
  float wallReflect;
  float dryGain;
  float earlySize;
  float lateSize;
  float diffusion;
  float returnHighpass;
};
};


struct snd_alias_t
struct SndIndexEntry
{
  unsigned __int16 value;
  unsigned __int16 next;
};
 
struct SndAssetBankHeader
{
{
const char *aliasName;
  unsigned int magic;
int aliasNameHash;
  unsigned int version;
const char *string2;
  unsigned int entrySize;
const char *string3;
  unsigned int checksumSize;
int unknown1;
  unsigned int dependencySize;
const char *string4;
  unsigned int entryCount;
int flags1;
  unsigned int dependencyCount;
int flags2;
  unsigned int pad32;
int duck;
  __int64 fileSize;
int contextType;
  __int64 entryOffset;
int contextValue;
  __int64 checksumOffset;
int stopOnPlay;
  char checksumChecksum[16];
int futzPatch;
  char dependencies[512];
short fluxTime;
  char padding[1464];
short startDelay;
short reverbSend;
short centerSend;
short volMin;
short volMax;
short pitchMin;
short pitchMax;
short distMin;
short distMaxDry;
short distMaxWet;
short envelopMin;
short envelopMax;
short envelopPercent;
short fadeIn;
short fadeOut;
short dopplerScale;
char priorityThresholdMin;
char priorityThresholdMax;
char priority;
char occlusionLevel;
char priorityMin;
char priorityMax;
char pan;
char limitCount;
char entityLimitCount;
char snapshotGroup;
};
};


struct snd_alias_list_t // 0x14
#pragma pack(push, 1)
struct SndRuntimeAssetBank
{
{
const char *aliasName;
  const char *zone;
int aliasNameHash;
  const char *language;
snd_alias_t *head; // count = count
  int fileHandle;
int count;
  SndAssetBankHeader header;
char unknown2[4];
  unsigned int entryOffset;
  char linkTimeChecksum[16];
  char filename[256];
  bool indicesLoaded;
  bool indicesAllocated;
};
};
#pragma pack(pop)


struct SndRadverb // 0x64
struct SndDialogScriptIdLookup
{
{
char name[0x20];
  unsigned int scriptId;
int nameHash;
  unsigned int aliasId;
float smoothing;
float earlyTime;
float lateTime;
float earlyGain
float lateGain;
float returnGain;
float earlyLpf;
float lateLpf;
float inputLpf;
float dampLpf;
float wallReflect;
float dryGain;
float earlySize;
float lateSize;
float diffusion;
float returnHighpass;
};
};


struct SndBank // 0x1294
struct SndBank // 0x1294
{
{
const char *name;
  const char *name;
int aliasCount;
  unsigned int aliasCount;
snd_alias_list_t *alias;
  SndAliasList *alias;
int *aliasIndex;
  SndIndexEntry *aliasIndex;
int numRadverbs;
  unsigned int radverbCount;
SndRadverb *radverbs;
  SndRadverb *radverbs;
int duckCount;
  unsigned int duckCount;
SndDuck *ducks;
  SndDuck *ducks;
SndStruct4 unk5; // 0x20
  SndRuntimeAssetBank streamAssetBank;
SndStruct4 unk6; // 0x942
  SndRuntimeAssetBank loadAssetBank;
SndStruct5 unk7; // 0x1264
  SndLoadedAssets loadedAssets;
int count4; // 0x1280
  unsigned int scriptIdLookupCount;
char *unk4; // size = 8 * count4
  SndDialogScriptIdLookup *scriptIdLookups;
char unknown[0xC];
  SndBankState state;
  int streamRequestId;
  bool pendingIo;
  bool ioError;
  bool runtimeAssetLoad;
};
};
</source>
</source>

Latest revision as of 19:27, 24 June 2015

Infinity Ward

struct SpeakerLevels
{
  int speaker;
  int numLevels;
  float levels[2];
};

struct ChannelMap
{
  int entryCount;	// how many entries are used
  SpeakerLevels speakers6];
};

struct SpeakerMap
{
  bool isDefault;
  const char *name;
  ChannelMap channelMaps[2][2];
};

enum snd_alias_type_t : char
{
	SAT_UNKNOWN = 0x0,
	SAT_LOADED = 0x1,
	SAT_STREAMED = 0x2,
	SAT_PRIMED = 0x3,
	SAT_COUNT = 0x4,
};

struct StreamFileNamePacked
{
  unsigned __int64 offset;
  unsigned __int64 length;
};

struct StreamFileNameRaw
{
  const char *dir;
  const char *name;
};

union StreamFileInfo
{
  StreamFileNameRaw raw;
  StreamFileNamePacked packed;
};

struct StreamFileName
{
  unsigned __int16 isLocalized;
  unsigned __int16 fileIndex;
  StreamFileInfo info;
};

struct StreamedSound
{
  StreamFileName filename;
  unsigned int totalMsec;
};

struct PrimedSound
{
  StreamFileName filename;
  LoadedSound *loadedPart;
  int dataOffset;
  int totalSize;
  unsigned int primedCrc;
};

union SoundData
{
  LoadedSound *loadSnd;	// SoundFile->type == SAT_LOADED
  StreamedSound streamSnd;	// SoundFile->type == SAT_STREAMED
  PrimedSound primedSnd;	// SoundFile->type == SAT_PRIMED
};

struct SoundFile	// 0x10
{
	snd_alias_type_t type;
	bool exists;
	SoundFileRef sound;
};

struct snd_alias_t
{
  const char *aliasName;
  const char *subtitle;
  const char *secondaryAliasName;
  const char *chainAliasName;
#ifndef COD4
  const char *mixerGroup;
#endif
  SoundFile *soundFile;
  int sequence;
  float volMin;
  float volMax;
#if defined(MW3) || defined(GHOSTS)
  int volModIndex;
#endif
  float pitchMin;
  float pitchMax;
  float distMin;
  float distMax;
#ifndef COD4
  float velocityMin;
#endif
  int flags;
#if defined(MW3) || defined(GHOSTS)
  char masterPriority;
  float masterPercentage;
#endif
  float slavePercentage;
  float probability;
  float lfePercentage;
  float centerPercentage;
  int startDelay;
  SndCurve *volumeFalloffCurve;
#ifdef GHOSTS
  SndCurve *lpfCurve;
  SndCurve *reverbSendCurve;
#endif
  float envelopMin;
  float envelopMax;
  float envelopPercentage;
  SpeakerMap *speakerMap;
#ifdef GHOSTS
  float wetMixOverride;
  OcclusionShape *occlusionShape;
  char allowDoppler;
  DopplerPreset *dopplerPreset;
#endif
};

struct snd_alias_list_t
{
  const char *aliasName;
  snd_alias_t *head;
  int count;
};

World at War

struct PrimedSound
{
	const char *unknownString;
	const char *buffer;
	int size;
};

struct StreamedSound
{
	struct
	{
		unsigned int hash;
		const char *dir;
		const char *name;
	};
	PrimedSound *primedSnd;
};

union SoundFileRef
{
	LoadedSound *loadSnd;
	StreamedSound streamSnd;
};
struct SoundFile
{
	snd_alias_type_t type;
	bool exists;
	SoundFileRef u;
};

struct snd_alias_t	// 0xB8
{
	const char *aliasName;
	unsigned int aliasNameHash;
	const char *subtitle;
	const char *secondaryAliasName;
	const char *chainAliasName;
	SoundFile *soundFile;
	int sequence;
	float volMin;
	float volMax;
	float pitchMin;
	float pitchMax;
	float distMin;
	float distMax;
	float distReverbMax;
	float slavePercentage;
	float probability;
	float lifePercentage;
	float centerPercentage;
	float envelopMin;
	float envelopMax;
	float realDelay;
	int minPriority;
	float maxPriority;
	float minPriorityThreshold;
	float maxPriorityThreshold;
	float reverbSend;
	float teamVolMod;
	float teamPitchMod;
	float occlusionLevel;
	float occlusionWetDry;
	float moveTime;
	int startDelay;
	int speakerMap;
	int flags;
	int volumeFallOffCurve;
	int reverbFallOffCurve;
	int volumeMinFallOffCurve;
	int reverbMinFallOfCurve;
	int limitCount;
	int limitType;
	int entityLimitCount;
	int entityLimitType;
	int randomizeType;
	float cylInnerRadius;
	float cylOuterRadius;
	float cylOuterLevel;
};

struct snd_alias_list_t
{
	const char *aliasName;
	snd_alias_t *head;
	int count;
};

Black Ops

struct SndIndexEntry
{
  unsigned __int16 value;
  unsigned __int16 next;
};

struct snd_radverb
{
  char name[32];
  unsigned int id;
  float smoothing;
  float earlyTime;
  float lateTime;
  float earlyGain;
  float lateGain;
  float returnGain;
  float earlyLpf;
  float lateLpf;
  float inputLpf;
  float dampLpf;
  float wallReflect;
  float dryGain;
  float earlySize;
  float lateSize;
  float diffusion;
};

struct snd_snapshot
{
  char name[32];
  unsigned int id;
  char occlusionName[32];
  unsigned int occlusionId;
  float fadeIn;
  float fadeOut;
  float distance;
  unsigned int fadeInCurve;
  unsigned int fadeOutCurve;
  float attenuation[64];
};

struct snd_alias_t
{
  const char *name;
  unsigned int id;
  const char *subtitle;
  const char *secondaryname;
  SoundFile *soundFile;
  unsigned int flags;
  unsigned int duck;
  unsigned int contextType;
  unsigned int contextValue;
  unsigned __int16 fluxTime;
  unsigned __int16 startDelay;
  unsigned __int16 reverbSend;
  unsigned __int16 centerSend;
  unsigned __int16 volMin;
  unsigned __int16 volMax;
  unsigned __int16 teamVolMod;
  unsigned __int16 pitchMin;
  unsigned __int16 pitchMax;
  unsigned __int16 teamPitchMod;
  unsigned __int16 distMin;
  unsigned __int16 distMax;
  unsigned __int16 distReverbMax;
  unsigned __int16 envelopMin;
  unsigned __int16 envelopMax;
  unsigned __int16 envelopPercentage;
  char minPriorityThreshold;
  char maxPriorityThreshold;
  char probability;
  char occlusionLevel;
  char occlusionWetDry;
  char minPriority;
  char maxPriority;
  char pan;
  char dryCurve;
  char wetCurve;
  char dryMinCurve;
  char wetMinCurve;
  char limitCount;
  char entityLimitCount;
  char snapshotGroup;
};

struct SndBank
{
  const char *name;
  unsigned int aliasCount;
  snd_alias_list_t *alias;
  SndIndexEntry *aliasIndex;
  unsigned int packHash;
  unsigned int packLocation;
  unsigned int radverbCount;
  snd_radverb *radverbs;
  unsigned int snapshotCount;
  snd_snapshot *snapshots;
};

Black Ops 2

enum SndBankState
{
  SND_BANK_STATE_NEW = 0x0,
  SND_BANK_STATE_STREAM_HEADER = 0x1,
  SND_BANK_STATE_STREAM_TOC = 0x2,
  SND_BANK_STATE_LOADED_HEADER = 0x3,
  SND_BANK_STATE_LOADED_TOC = 0x4,
  SND_BANK_STATE_LOADED_ASSET_WAIT = 0x5,
  SND_BANK_STATE_LOADED_ASSETS = 0x6,
  SND_BANK_STATE_READY_TO_USE = 0x7,
  SND_BANK_STATE_ERROR = 0x8,
};

struct SndAssetBankEntry
{
  unsigned int id;
  unsigned int size;
  unsigned int offset;
  unsigned int frameCount;
  char frameRateIndex;
  char channelCount;
  char looping;
  char format;
};

struct SndLoadedAssets // 0x1C
{
  const char *zone;
  const char *language;
  unsigned int loadedCount;
  unsigned int entryCount;
  SndAssetBankEntry *entries;
  unsigned int dataSize;
  char *data;
};

struct SndDuck	// 0x4C
{
  char name[32];
  unsigned int id;
  float fadeIn;
  float fadeOut;
  float startDelay;
  float distance;
  float length;
  unsigned int fadeInCurve;
  unsigned int fadeOutCurve;
  float (*attenuation)[0x80];
  float (*filter)[0x80];
  int updateWhilePaused;
};

struct SndAlias
{
  const char *name;
  unsigned int id;
  const char *subtitle;
  const char *secondaryname;
  unsigned int assetId;
  const char *assetFileName;
  unsigned int flags0;
  unsigned int flags1;
  unsigned int duck;
  unsigned int contextType;
  unsigned int contextValue;
  unsigned int stopOnPlay;
  unsigned int futzPatch;
  unsigned __int16 fluxTime;
  unsigned __int16 startDelay;
  unsigned __int16 reverbSend;
  unsigned __int16 centerSend;
  unsigned __int16 volMin;
  unsigned __int16 volMax;
  unsigned __int16 pitchMin;
  unsigned __int16 pitchMax;
  unsigned __int16 distMin;
  unsigned __int16 distMax;
  unsigned __int16 distReverbMax;
  unsigned __int16 envelopMin;
  unsigned __int16 envelopMax;
  unsigned __int16 envelopPercentage;
  __int16 fadeIn;
  __int16 fadeOut;
  __int16 dopplerScale;
  char minPriorityThreshold;
  char maxPriorityThreshold;
  char probability;
  char occlusionLevel;
  char minPriority;
  char maxPriority;
  char pan;
  char limitCount;
  char entityLimitCount;
  char duckGroup;
};

struct SndAliasList // 0x14
{
  const char *name;
  unsigned int id;
  SndAlias *head;
  int count;
  int sequence;
};

struct SndRadverb
{
  char name[32];
  unsigned int id;
  float smoothing;
  float earlyTime;
  float lateTime;
  float earlyGain;
  float lateGain;
  float returnGain;
  float earlyLpf;
  float lateLpf;
  float inputLpf;
  float dampLpf;
  float wallReflect;
  float dryGain;
  float earlySize;
  float lateSize;
  float diffusion;
  float returnHighpass;
};

struct SndIndexEntry
{
  unsigned __int16 value;
  unsigned __int16 next;
};

struct SndAssetBankHeader
{
  unsigned int magic;
  unsigned int version;
  unsigned int entrySize;
  unsigned int checksumSize;
  unsigned int dependencySize;
  unsigned int entryCount;
  unsigned int dependencyCount;
  unsigned int pad32;
  __int64 fileSize;
  __int64 entryOffset;
  __int64 checksumOffset;
  char checksumChecksum[16];
  char dependencies[512];
  char padding[1464];
};

#pragma pack(push, 1)
struct SndRuntimeAssetBank
{
  const char *zone;
  const char *language;
  int fileHandle;
  SndAssetBankHeader header;
  unsigned int entryOffset;
  char linkTimeChecksum[16];
  char filename[256];
  bool indicesLoaded;
  bool indicesAllocated;
};
#pragma pack(pop)

struct SndDialogScriptIdLookup
{
  unsigned int scriptId;
  unsigned int aliasId;
};

struct SndBank // 0x1294
{
  const char *name;
  unsigned int aliasCount;
  SndAliasList *alias;
  SndIndexEntry *aliasIndex;
  unsigned int radverbCount;
  SndRadverb *radverbs;
  unsigned int duckCount;
  SndDuck *ducks;
  SndRuntimeAssetBank streamAssetBank;
  SndRuntimeAssetBank loadAssetBank;
  SndLoadedAssets loadedAssets;
  unsigned int scriptIdLookupCount;
  SndDialogScriptIdLookup *scriptIdLookups;
  SndBankState state;
  int streamRequestId;
  bool pendingIo;
  bool ioError;
  bool runtimeAssetLoad;
};