{"name":"Arma 3: Sound: SoundShader","title":"Arma 3: Sound: SoundShader","type":"topic","url":"https://community.bistudio.com/wiki/Arma_3:_Sound:_SoundShader","revid":364233,"updated":"2024-05-06T09:38:15Z","aliases":["Arma 3 Sound: SoundShader"],"markdown":"### SoundShader\n\nSoundShader is the lowest level of sound configuration. It contains the definition of sound files and basic set of parameters.\n\nAll SoundShaders have to be defined in the base class **CfgSoundShaders**.\n\n> [!NOTE]\n> For single SoundShader (SoundSet respectively), use sound files with the same sampling rate.\n\n| Parameter | Unit/values | Default | Description |\n|---|---|---|---|\n| *samples* | { [\"path/sound\",p], ... } | none | - array containing sound file name with paths and probability values (p), wav, wss, ogg are accepted file types, 16bit/44.1KHz wav converted to wss should always work fine<br>- probability values are normalized to 1, in every case there is one sample selected<br>- no immediate repeat (engine never selects the same sample twice in a row) |\n| *volume* | float (0..n) or [dBFS] | 1 (= db0) | - base volume value<br>- use format db*x* for decibels in dBFS (e.g. db-6 for -6 dBFS)<br>- use float number to specify amplitude value directly |\n| *frequency* | (0.5..2) | 1 | - base pitch value, 1 = no change<br>- if shader is used in submix (more than one SoundShader in SoundSet), this parameter is currently ignored |\n| *range* | (0..n) [m] | 0 | - radius of sphere (with center on sound source position) where sound is playing |\n| *rangeCurve* | {{d0, v0}, {d1, v1}, ... } or Class name | none | - array of points & corresponding amplitude multipliers or class name defined in cfgSoundCurves<br>- if shader is not used in submix (meaning it is the only one SoundShader in SoundSet), this parameter is currently ignored |\n| *limitation* | bool | false | - adds SoundShader to the group of SoundShaders, where number of simultaneously playing SoundShaders will be limited (within single SoundSet) |\n\n```cpp\nclass CfgSoundShaders\n{\n    class ACPC2_closeShot_SoundShader\n    {\n        samples[] =\n        {\n            { \"A3\\Sounds_F\\arsenal\\weapons\\Pistols\\Acpc2\\ACPC2_closeShot_01\", 1 },\n            { \"A3\\Sounds_F\\arsenal\\weapons\\Pistols\\Acpc2\\ACPC2_closeShot_02\", 1 },\n            { \"A3\\Sounds_F\\arsenal\\weapons\\Pistols\\Acpc2\\ACPC2_closeShot_03\", 2 } // example: sample has a higher chance of being picked\n        };\n        volume = db3; // additional gain, +3dB\n        range = 50;\n        rangeCurve = closeShotCurve; //classname of a curve, defined in cfgSoundCurves\n};\n```","sections":[{"heading":"SoundShader","level":3,"markdown":"SoundShader is the lowest level of sound configuration. It contains the definition of sound files and basic set of parameters.\n\nAll SoundShaders have to be defined in the base class **CfgSoundShaders**.\n\n> [!NOTE]\n> For single SoundShader (SoundSet respectively), use sound files with the same sampling rate.\n\n| Parameter | Unit/values | Default | Description |\n|---|---|---|---|\n| *samples* | { [\"path/sound\",p], ... } | none | - array containing sound file name with paths and probability values (p), wav, wss, ogg are accepted file types, 16bit/44.1KHz wav converted to wss should always work fine<br>- probability values are normalized to 1, in every case there is one sample selected<br>- no immediate repeat (engine never selects the same sample twice in a row) |\n| *volume* | float (0..n) or [dBFS] | 1 (= db0) | - base volume value<br>- use format db*x* for decibels in dBFS (e.g. db-6 for -6 dBFS)<br>- use float number to specify amplitude value directly |\n| *frequency* | (0.5..2) | 1 | - base pitch value, 1 = no change<br>- if shader is used in submix (more than one SoundShader in SoundSet), this parameter is currently ignored |\n| *range* | (0..n) [m] | 0 | - radius of sphere (with center on sound source position) where sound is playing |\n| *rangeCurve* | {{d0, v0}, {d1, v1}, ... } or Class name | none | - array of points & corresponding amplitude multipliers or class name defined in cfgSoundCurves<br>- if shader is not used in submix (meaning it is the only one SoundShader in SoundSet), this parameter is currently ignored |\n| *limitation* | bool | false | - adds SoundShader to the group of SoundShaders, where number of simultaneously playing SoundShaders will be limited (within single SoundSet) |\n\n```cpp\nclass CfgSoundShaders\n{\n    class ACPC2_closeShot_SoundShader\n    {\n        samples[] =\n        {\n            { \"A3\\Sounds_F\\arsenal\\weapons\\Pistols\\Acpc2\\ACPC2_closeShot_01\", 1 },\n            { \"A3\\Sounds_F\\arsenal\\weapons\\Pistols\\Acpc2\\ACPC2_closeShot_02\", 1 },\n            { \"A3\\Sounds_F\\arsenal\\weapons\\Pistols\\Acpc2\\ACPC2_closeShot_03\", 2 } // example: sample has a higher chance of being picked\n        };\n        volume = db3; // additional gain, +3dB\n        range = 50;\n        rangeCurve = closeShotCurve; //classname of a curve, defined in cfgSoundCurves\n};\n```"}],"categories":["Arma 3: Sound"],"groups":["Configuration"]}