Sound Asset: Difference between revisions
Aerosoul94 (talk | contribs) No edit summary |
|||
| Line 307: | Line 307: | ||
== Black Ops 2 == | == Black Ops 2 == | ||
<source lang="cpp"> | <source lang="cpp"> | ||
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 | 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 | 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; | |||
float *filter; | |||
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 | 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]; | |||
}; | }; | ||
struct | #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 | struct SndDialogScriptIdLookup | ||
{ | { | ||
unsigned int scriptId; | |||
unsigned int aliasId; | |||
}; | }; | ||
struct SndBank // 0x1294 | 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; | |||
}; | }; | ||
</source> | </source> | ||
Revision as of 06:36, 21 December 2014
Infinity Ward
struct SpeakerMapChannelEntry
{
int InputChannel;
int OutputChannel;
float CurrentVolume;
float TargetVolume;
};
struct SpeakerMapChannel
{
int entryCount; // how many entries are used
SpeakerMapChannelEntry entries[6];
};
struct SpeakerMap
{
bool isDefault;
const char *name;
SpeakerMapChannel 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 StreamedSound
{
int packfileNum;
union
{
const char *strings[2]; // if packfileNum == 0
struct
{
int soundOffset;
int soundSize;
};
};
};
union SoundData
{
LoadedSound *loadSnd; // SoundFile->type == SAT_LOADED
StreamedSound streamSnd; // SoundFile->type == SAT_STREAMED
};
struct SoundFile // 0x10
{
snd_alias_type_t type;
bool exists;
SoundData sound;
};
struct snd_alias_t
{
const char *aliasName;
const char *subtitle;
const char *secondaryAliasName;
const char *chainAliasName;
#ifndef COD4
const char *devSoundMixerGroup;
#endif
SoundFile *soundFile;
int sequence;
float volMin;
float volMax;
#ifdef MW3 || GHOSTS
short volMod;
#endif
float pitchMin;
float pitchMax;
float distMin;
float distMax;
#ifndef COD4
float velocityMin;
#endif
int flags;
#ifdef MW3 || GHOSTS
char masterPriority;
float masterPercentage;
#endif
float slavePercentage;
float probability;
float lfePercentage;
float centerPercentage;
int startDelay;
SndCurve *volumeFalloffCurve;
#ifdef GHOSTS
LPFCurve *unknownLPFCurve;
ReverbSendCurve *unknownReverbSendCurve;
#endif
float envelopMin;
float envelopMax;
float envelopPercentage;
SpeakerMap *speakerMap;
#ifdef GHOSTS
int unknown3;
char (*unknown4)[0x18];
int unknown5;
DopplerPreset *unknownDopplerPreset;
#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 unknown;
};
struct StreamedSound
{
struct
{
int unknown;
const char *unknownStrings[2];
};
PrimedSound *primedSnd;
};
struct SoundFile
{
snd_alias_type_t type;
bool exists;
union
{
StreamedSound streamSnd;
LoadedSound *loadSnd;
} 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 SndRadverb
{
char name[0x20];
int nameHash;
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 SndSnapshot
{
char name[0x20];
int nameHash;
char occlusion[0x20];
int occlusionHash;
int fadeIn;
int fadeOut;
int distance;
int fadeInCurve;
int fadeOutCurve;
float field_5C[64];
};
struct snd_alias_t
{
const char *aliasName;
int subtitle;
const char *secondaryAliasName;
const char *chainAliasName;
SoundFile *soundFile;
int flags;
int duck;
int contextType;
int contextValue;
short moveTime;
short startDelay;
short centerSend;
short reverbSend;
short volMin;
short volMax;
short teamVolMod;
short pitchMin;
short pitchMax;
short teamPitchMod;
short distMin;
short distMax;
short distReverbMax;
short envelopMin;
short envelopMax;
short envelopPercentage;
char minPriorityThreshold;
char maxPriorityThreshold;
char probability;
char occlusionLevel;
char occlusionWetDry;
char minPriority;
char maxPriority;
char pan;
char volumeFalloffCurve;
char reverbFalloffCurve;
char volumeMinFalloffCurve;
char reverbMinFalloffCurve;
char limitCount;
char entityLimitCount;
char snapshot;
};
struct SndBank
{
int name;
int aliasCount;
snd_alias_list_t *alias;
int *aliasIndex;
int unknown[2];
int numRadverbs;
SndRadverb *radverbs;
int numSnapshots;
SndSnapshot *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;
float *filter;
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;
};