Sound Driver Globals Asset: Difference between revisions

From COD Engine Research
 
(3 intermediate revisions by 2 users not shown)
Line 39: Line 39:
{
{
   int presetOverridden;
   int presetOverridden;
#ifdef IW6
  XAUDIO2FX_REVERB_I3DL2_PARAMETERS reverbSettings;//Located in xaudio2fx.h which is included in the 360SDK
#else
   XAUDIOREVERBSETTINGS reverbSettings;
   XAUDIOREVERBSETTINGS reverbSettings;
#endif
};
struct SndGlobalSettings_t
{
  float globalVolumeModifier;
};
};


struct SndDriverGlobals
struct SndDriverGlobals
{
{
  const char *name;
#ifdef IW6
  SndGlobalSettings_t settings;
#endif
#ifdef XBOX
#ifdef XBOX
#ifdef GHOSTS
  XaReverbSettings (*reverbSettings)[0x1C];
#else
   XaReverbSettings (*reverbSettings)[0x1A];
   XaReverbSettings (*reverbSettings)[0x1A];
#endif
#endif
#endif
  const char *name;
#ifdef PS3
#ifdef PS3
   float unknown;
   float unknown;
Line 57: Line 65:
};
};
</syntaxhighlight>
</syntaxhighlight>
== World at War ==
== World at War ==
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
struct snd_reverb_patch_t
{
char name[32];
float room;
float roomHF;
float roomRolloffFactor;
float decayTime;
float decayHFRatio;
float reflections;
float reflectionsDelay;
float reverb;
float reverbDelay;
float diffusion;
float density;
float HFReference;
};
enum snd_limit_type_t
{
SND_LIMIT_NONE = 0x0,
SND_LIMIT_OLDEST = 0x1,
SND_LIMIT_REJECT = 0x2,
SND_LIMIT_PRIORITY = 0x3,
SND_LIMIT_SOFTEST = 0x4,
SND_LIMIT_COUNT = 0x5,
};
enum snd_category_t
{
SND_CATEGORY_SFX = 0x0,
SND_CATEGORY_MUSIC = 0x1,
SND_CATEGORY_VOICE = 0x2,
};
struct snd_bus_info_t
{
char name[32];
float volumeMod;
int maxVoices;
int restricted;
int pausable;
int stopOnDeath;
int isMusic;
snd_category_t category;
snd_limit_type_t voiceLimitType;
};
struct snd_curve_t
{
char name[32];
int pointCount;
float points[8][2];
};
struct snd_speaker_map
{
int input_channel_count;
int output_channel_count;
float volumes[16];
};
struct snd_speaker_map_set
{
char name[32];
snd_speaker_map channelMaps[4];
};
struct snd_master_effect_t
{
char name[32];
float masterRingmod;
float reverbRingmod;
float masterLPRatio;
float masterLPDB;
float masterHPRatio;
float masterHPDB;
};
struct SndDriverGlobals
struct SndDriverGlobals
{
{
   const char * name;
   const char * name;
      char unknown[0x5C00];
  snd_reverb_patch_t reverbPatches[64];
  snd_bus_info_t buses[64];
  snd_curve_t curves[32];
  snd_speaker_map_set speakerMaps[32];
  snd_master_effect_t masterEffects[16];
};
};
</syntaxhighlight>
</syntaxhighlight>
== Black Ops 1 ==
== Black Ops 1 ==
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
Line 170: Line 262:
== Black Ops 2 ==
== Black Ops 2 ==
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
struct SndGroup
enum SndMenuCategory
{
  SND_CATEGORY_SFX = 0x0,
  SND_CATEGORY_MUSIC = 0x1,
  SND_CATEGORY_VOICE = 0x2,
  SND_CATEGORY_UI = 0x3,
  SND_CATEGORY_CINEMATIC = 0x4,
  SND_CATEGORY_COUNT = 0x5,
};
 
struct SndVolumeGroup
{
{
char name[0x20];
  char name[0x20];
char parent[0x20];
  char parentName[0x20];
int nameHash;
  unsigned int id;
int unknown;
  int parentIndex;
int category;
  SndMenuCategory category;
short attenuationSp;
  unsigned __int16 attenuationSp;
short attenuationMp;
  unsigned __int16 attenuationMp;
};
};


Line 184: Line 286:
{
{
char name[0x20];
char name[0x20];
int nameHash;
unsigned int id;
vec2_t xy[8];
vec2_t points[8];
};
};


Line 191: Line 293:
{
{
char name[0x20];
char name[0x20];
unsigned int nameHash;
unsigned int id;
float front;
float front;
float back;
float back;
Line 202: Line 304:
struct SndDuckGroup // 0x24
struct SndDuckGroup // 0x24
{
{
char name[0x20];
  char name[32];
int nameHash;
  unsigned int id;
};
};


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


Line 269: Line 371:
};
};


struct SndVoiceDuck // 0x3C
struct SndSidechainDuck
{
{
char name[0x20];
  char name[32];
int nameHash;
  unsigned int id;
float G;
  float g;
float F;
  float f;
float Q;
  float q;
float TF;
  float ta;
float TA;
  float tr;
float TR;
  float tf;
};
};


struct SndUnknown
struct SndFutz
{
{
char name[0x20];
  char name[0x20];
int name;
  unsigned int id;
float BpfF;
  float bpfF;
float BpfQ;
  float bpfQ;
float LsG;
  float lsG;
float LsF;
  float lsF;
float LsQ
  float lsQ;
float distortion;
  float dist;
float PreG;
  float preG;
float PostG;
  float postG;
float TH;
  float th;
float TG;
  float tg;
float ClipPre;
  float clippre;
float ClipPost;
  float clippost;
float Blend;
  float blend;
float StartAlias;
  unsigned int startAliasId;
float StopAlias;
  unsigned int stopAliasId;
float LoopAlias;
  unsigned int loopAliasId;
};
};


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

Latest revision as of 17:45, 7 February 2015

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;
#ifdef IW6
  XAUDIO2FX_REVERB_I3DL2_PARAMETERS reverbSettings;//Located in xaudio2fx.h which is included in the 360SDK
#else
  XAUDIOREVERBSETTINGS reverbSettings;
#endif
};

struct SndGlobalSettings_t
{
  float globalVolumeModifier;
};

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

World at War

struct snd_reverb_patch_t
{
	char name[32];
	float room;
	float roomHF;
	float roomRolloffFactor;
	float decayTime;
	float decayHFRatio;
	float reflections;
	float reflectionsDelay;
	float reverb;
	float reverbDelay;
	float diffusion;
	float density;
	float HFReference;
};

enum snd_limit_type_t	
{
	SND_LIMIT_NONE = 0x0,
	SND_LIMIT_OLDEST = 0x1,
	SND_LIMIT_REJECT = 0x2,
	SND_LIMIT_PRIORITY = 0x3,
	SND_LIMIT_SOFTEST = 0x4,
	SND_LIMIT_COUNT = 0x5,
};

enum snd_category_t	
{
	SND_CATEGORY_SFX = 0x0,
	SND_CATEGORY_MUSIC = 0x1,
	SND_CATEGORY_VOICE = 0x2,
};

struct snd_bus_info_t
{
	char name[32];
	float volumeMod;
	int maxVoices;
	int restricted;
	int pausable;
	int stopOnDeath;
	int isMusic;
	snd_category_t category;
	snd_limit_type_t voiceLimitType;
};

struct snd_curve_t
{
	char name[32];
	int pointCount;
	float points[8][2];
};

struct snd_speaker_map
{
	int input_channel_count;
	int output_channel_count;
	float volumes[16];
};

struct snd_speaker_map_set
{
	char name[32];
	snd_speaker_map channelMaps[4];
};

struct snd_master_effect_t
{
	char name[32];
	float masterRingmod;
	float reverbRingmod;
	float masterLPRatio;
	float masterLPDB;
	float masterHPRatio;
	float masterHPDB;
};

struct SndDriverGlobals
{
  const char * name;
  snd_reverb_patch_t reverbPatches[64];
  snd_bus_info_t buses[64];
  snd_curve_t curves[32];
  snd_speaker_map_set speakerMaps[32];
  snd_master_effect_t masterEffects[16];
};

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

enum SndMenuCategory
{
  SND_CATEGORY_SFX = 0x0,
  SND_CATEGORY_MUSIC = 0x1,
  SND_CATEGORY_VOICE = 0x2,
  SND_CATEGORY_UI = 0x3,
  SND_CATEGORY_CINEMATIC = 0x4,
  SND_CATEGORY_COUNT = 0x5,
};

struct SndVolumeGroup
{
  char name[0x20];
  char parentName[0x20];
  unsigned int id;
  int parentIndex;
  SndMenuCategory category;
  unsigned __int16 attenuationSp;
  unsigned __int16 attenuationMp;
};

struct SndCurve
{
	char name[0x20];
	unsigned int id;
	vec2_t points[8];
};

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

struct SndDuckGroup	// 0x24
{
  char name[32];
  unsigned int id;
};

struct SndMaster
{
  char name[0x20];
  unsigned int id;
  int lowE;
  float lowG;
  float lowF;
  float lowQ;
  int peak1E;
  float peak1G;
  float peak1F;
  float peak1Q;
  int peak2E;
  float peak2G;
  float peak2F;
  float peak2Q;
  int hiE;
  float hiG;
  float hiF;
  float hiQ;
  float eqG;
  int compE;
  float compPG;
  float compMG;
  float compT;
  float compR;
  float compTA;
  float compTR;
  int 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;
  int busReverbE;
  int busFxE;
  int busVoiceE;
  int busPfutzE;
  int busHdrfxE;
  int busUiE;
  int busMusicE;
  int busMovieE;
  int hdrfxCompE;
  int voiceEqE;
  int voiceCompE;
};

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

struct SndSidechainDuck
{
  char name[32];
  unsigned int id;
  float g;
  float f;
  float q;
  float ta;
  float tr;
  float tf;
};

struct SndFutz
{
  char name[0x20];
  unsigned int id;
  float bpfF;
  float bpfQ;
  float lsG;
  float lsF;
  float lsQ;
  float dist;
  float preG;
  float postG;
  float th;
  float tg;
  float clippre;
  float clippost;
  float blend;
  unsigned int startAliasId;
  unsigned int stopAliasId;
  unsigned int loopAliasId;
};

struct SndDriverGlobals
{
  const char *name;
  unsigned int groupCount;
  SndVolumeGroup *groups;
  unsigned int curveCount;
  SndCurve *curves;
  unsigned int panCount;
  SndPan *pans;
  unsigned int duckGroupCount;
  SndDuckGroup *duckGroups;
  unsigned int contextCount;
  SndContext *contexts;
  unsigned int masterCount;
  SndMaster *masters;
  unsigned int voiceDuckCount;
  SndSidechainDuck *voiceDucks;
  unsigned int futzCount;
  SndFutz *futzes;
};