Sound Driver Globals Asset: Difference between revisions

From COD Engine Research
Line 170: Line 170:
== Black Ops 2 ==
== Black Ops 2 ==
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
struct SndGroup
{
char name[0x20];
char parent[0x20];
int nameHash;
int unknown;
int category;
short attenuationSp;
short attenuationMp;
};
struct SndCurve
{
char name[0x20];
int nameHash;
vec2_t xy[8];
};
struct SndPan
{
char name[0x20];
unsigned int nameHash;
float front;
float back;
float center;
float lfe;
float left;
float right;
};
struct SndDuckGroup // 0x24
{
char name[0x20];
int nameHash;
};
struct SndMaster
{
char name[0x20];
int nameHash;
float lowE;
float lowG;
float lowF;
float lowQ;
float peak1E;
float peak1G;
float peak1F;
float peak1Q;
float peak2E;
float peak2G;
float peak2F;
float peak2Q;
float hiE;
float hiG;
float hiF;
float hiQ;
float eqG;
float compE;
float compPG;
float compMG;
float compT;
float compR;
float compTA;
float compTR;
float limitE;
float limitPG;
float limitMG;
float limitT;
float limitR;
float limitTA;
float limitTR;
float busReverbG;
float busFxG;
float busVoiceG;
float busPfutzG;
float busHdrfxG;
float busUiG;
float busMusicG;
float busMovieG;
float busVcsG;
float busReverbE;
float busFxE;
float busVoiceE;
float busPfutzE;
float busHdrfxE;
float busUiE;
float busMusicE;
float busMovieE;
float hdrFxCompE;
float voiceEqE;
float voiceCompE;
};
struct SndContext
{
int type;
int value[8];
};
struct SndVoiceDuck // 0x3C
{
char name[0x20];
int nameHash;
float G;
float F;
float Q;
float TF;
float TA;
float TR;
};
struct SndUnknown
{
char name[0x20];
int name;
float BpfF;
float BpfQ;
float LsG;
float LsF;
float LsQ
float distortion;
float PreG;
float PostG;
float TH;
float TG;
float ClipPre;
float ClipPost;
float Blend;
float StartAlias;
float StopAlias;
float LoopAlias;
};
struct SndDriverGlobals
struct SndDriverGlobals
{
{
  const char * name;
const char * name;
      unsigned int groupCount;
unsigned int groupCount;
      char * groups; //Size = ((groupCount << 2) + groupCount) << 4
SndGroup * groups; //Size = groupCount * 0x50
      unsigned int curveCount;
unsigned int curveCount;
      char * curves; //Size = curveCount * 0x64
SndCurve * curves; //Size = curveCount * 0x64
      unsigned int panCount;
unsigned int panCount;
      char * pans; //Size = panCount * 0x3C
SndPan * pans; //Size = panCount * 0x3C
      unsigned int unknownCount1;
unsigned int duckGroupCount;
      char * unknown1; //Size = ((unknownCount1 << 3) + unknownCount1) << 2
SndDuckGroup * duckGroups; //Size = unknownCount1 * 0x24
      unsigned int unknownCount2;
unsigned int contextCount;
      char * unknown2; //Size = ((unknownCount2 << 3) + unknownCount2) << 2
SndContext * contexts; //Size = unknownCount2 * 0x24
      unsigned int unknownCount3;
unsigned int masterCount;
      char * unknown3; //Size = unknownCount3 * 0xF0
SndMaster * masters; //Size = unknownCount3 * 0xF0
      unsigned int unknownCount4;
unsigned int voiceDuckCount;
      char * unknown4; //Size = unknownCount4 * 0x3C
SndVoiceDuck * voiceDucks; //Size = unknownCount4 * 0x3C
      unsigned int unknownCount5;
unsigned int unknownCount5;
      char * unknown5; //Size = unknownCount5 * 0x64
SndUnknown * unknown5; //Size = unknownCount5 * 0x64
};
};
</syntaxhighlight>
</syntaxhighlight>

Revision as of 12:37, 21 February 2014

The global sound drivers asset (snddriverglobals) is part of the D3DBSP system produced by Radiant, and has existed on every CoD game so far. Only 1 is loaded into memory at a time, and they control how sound reacts in different rooms, particularly for 5.1 channel systems. While it has remained mostly unchanged on Infinity Ward games, Treyarch has completely changed it.

Infinity Ward Games

struct XAUDIOREVERBSETTINGS
{
  unsigned int ReflectionsDelay;
  char ReverbDelay;
  char RearDelay;
  char PositionLeft;
  char PositionRight;
  char PositionMatrixLeft;
  char PositionMatrixRight;
  char EarlyDiffusion;
  char LateDiffusion;
  char LowEQGain;
  char LowEQCutoff;
  char HighEQGain;
  char HighEQCutoff;
  float RoomFilterFreq;
  float RoomFilterMain;
  float RoomFilterHF;
  float ReflectionsGain;
  float ReverbGain;
  float DecayTime;
  float Density;
  float RoomSize;
};

struct XaReverbSettings
{
  int presetOverridden;
  XAUDIOREVERBSETTINGS reverbSettings;
};

struct SndDriverGlobals
{
#ifdef XBOX
 #ifdef GHOSTS
  XaReverbSettings (*reverbSettings)[0x1C];
 #else
  XaReverbSettings (*reverbSettings)[0x1A];
 #endif
#endif
  const char *name;
#ifdef PS3
  float unknown;
#endif
};

World at War

struct SndDriverGlobals
{
  const char * name;
       char unknown[0x5C00];
};

Black Ops 1

struct SndGroup
{
  char name[0x20];
  char parent[0x20];
  unsigned int nameHash;
  int unknown2;
  int category;
  short attenuationSp;
  short attenuationMp;
};

struct SndCurve
{
  char name[0x20];
  unsigned int nameHash;
  vec2_t xy[8];
};

struct SndPan
{
  char name[0x20];
  unsigned int nameHash;
  float front;
  float back;
  float center;
  float lfe;
  float left;
  float right;
};

struct SndSnapshotGroup
{
  char name[0x20];
};

struct SndContext
{
  int type;
  int unknown;
  int values[8];
};

struct SndMaster
{
  char name[0x20];
  unsigned int nameHash;
  float notchE;
  float notchG;
  float notchF;
  float notchQ;
  float lowE;
  float lowG;
  float lowF;
  float lowQ;
  float peak1E;
  float peak1G;
  float peak1F;
  float peak1Q;
  float peak2E;
  float peak2G;
  float peak2F;
  float peak2Q;
  float hiE;
  float hiG;
  float hiF;
  float hiQ;
  float eqG;
  float compE;
  float compPG;
  float compMG;
  float compT;
  float compR;
  float compTA;
  float compTR;
  float limitE;
  float limitPG;
  float limitMG;
  float limitT;
  float limitR;
  float limitTA;
  float limitTR;
};

struct SndDriverGlobals
{
       const char * name;
       unsigned int groupCount;
       SndGroup * groups; //Size = ((groupCount << 2) + groupCount) << 4
       unsigned int curveCount;
       SndCurve * curves; //Size = curveCount * 0x64
       unsigned int panCount;
       SndPan * pans; //Size = panCount * 0x3C
       unsigned int snapshotGroupCount;
       SndSnapshotGroup * snapshotGroups; //Size = snapshotGroupCount << 5
       unsigned int contextCount;
       SndContext * contexts; //Size = ((contextCount << 2) + contextCount) << 3
       unsigned int masterCount;
       SndMaster * masters; //Size = masterCount * 0xB0
};

Black Ops 2

struct SndGroup
{
	char name[0x20];
	char parent[0x20];
	int nameHash;
	int unknown;
	int category;
	short attenuationSp;
	short attenuationMp;
};

struct SndCurve
{
	char name[0x20];
	int nameHash;
	vec2_t xy[8];
};

struct SndPan
{
	char name[0x20];
	unsigned int nameHash;
	float front;
	float back;
	float center;
	float lfe;
	float left;
	float right;
};

struct SndDuckGroup	// 0x24
{
	char name[0x20];
	int nameHash;
};

struct SndMaster
{
	char name[0x20];
	int nameHash;
	float lowE;
	float lowG;
	float lowF;
	float lowQ;
	float peak1E;
	float peak1G;
	float peak1F;
	float peak1Q;
	float peak2E;
	float peak2G;
	float peak2F;
	float peak2Q;
	float hiE;
	float hiG;
	float hiF;
	float hiQ;
	float eqG;
	float compE;
	float compPG;
	float compMG;
	float compT;
	float compR;
	float compTA;
	float compTR;
	float limitE;
	float limitPG;
	float limitMG;
	float limitT;
	float limitR;
	float limitTA;
	float limitTR;
	float busReverbG;
	float busFxG;
	float busVoiceG;
	float busPfutzG;
	float busHdrfxG;
	float busUiG;
	float busMusicG;
	float busMovieG;
	float busVcsG;
	float busReverbE;
	float busFxE;
	float busVoiceE;
	float busPfutzE;
	float busHdrfxE;
	float busUiE;
	float busMusicE;
	float busMovieE;
	float hdrFxCompE;
	float voiceEqE;
	float voiceCompE;
};

struct SndContext
{
	int type;
	int value[8];
};

struct SndVoiceDuck	// 0x3C
{
	char name[0x20];
	int nameHash;
	float G;
	float F;
	float Q;
	float TF;
	float TA;
	float TR;
};

struct SndUnknown
{
	char name[0x20];
	int name;
	float BpfF;
	float BpfQ;
	float LsG;
	float LsF;
	float LsQ
	float distortion;
	float PreG;
	float PostG;
	float TH;
	float TG;
	float ClipPre;
	float ClipPost;
	float Blend;
	float StartAlias;
	float StopAlias;
	float LoopAlias;
};

struct SndDriverGlobals
{
	const char * name;
	unsigned int groupCount;
	SndGroup * groups; //Size = groupCount * 0x50
	unsigned int curveCount;
	SndCurve * curves; //Size = curveCount * 0x64
	unsigned int panCount;
	SndPan * pans; //Size = panCount * 0x3C
	unsigned int duckGroupCount;
	SndDuckGroup * duckGroups; //Size = unknownCount1 * 0x24
	unsigned int contextCount;
	SndContext * contexts; //Size = unknownCount2 * 0x24
	unsigned int masterCount;
	SndMaster * masters; //Size = unknownCount3 * 0xF0
	unsigned int voiceDuckCount;
	SndVoiceDuck * voiceDucks; //Size = unknownCount4 * 0x3C
	unsigned int unknownCount5;
	SndUnknown * unknown5; //Size = unknownCount5 * 0x64
};