Sound: SoundShader – Arma 3

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "};</syntaxhighlight>" to "}; </syntaxhighlight>")
m (Text replacement - "[[Arma 3 " to "[[Arma 3: ")
 
(4 intermediate revisions by the same user not shown)
Line 6: Line 6:
All SoundShaders have to be defined in the base class '''CfgSoundShaders'''.
All SoundShaders have to be defined in the base class '''CfgSoundShaders'''.


{| class="wikitable" style="color:black; background-color:#eeeeff;"
{{Feature | informative | For single SoundShader (SoundSet respectively), use sound files with the same sampling rate.}}
| For single SoundShader (SoundSet respectively), use sound files with the same sampling rate.
|}


{| class="wikitable" style="color:black; background-color:#fefefe;"
{| class="wikitable"


|-
|-
!parameter
! Parameter
!unit/values
! Unit/values
!default
! Default
!descriptions
! Description


|-
|-
!''sound''
 
|{["path/sound",p], ...}
! ''samples''
|none
| { ["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
* 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
Line 28: Line 27:


|-
|-
!''volume''
! ''volume''
|float (0..n) or [dBFS]
| float (0..n) or [dBFS]
|1 (= db0)
| 1 (= db0)
|
|
* base volume value
* base volume value
Line 37: Line 36:


|-
|-
!''frequency''
! ''frequency''
|(0.5..2)
| (0.5..2)
|1
| 1
|
|
* base pitch value, 1 = no change
* base pitch value, 1 = no change
Line 45: Line 44:


|-
|-
!''range''
! ''range''
| (0..n) [m]
| (0..n) [m]
| 0
| 0
Line 52: Line 51:


|-
|-
!''rangeCurve''
! ''rangeCurve''
| {{d0, v0}, {d1, v1}, ... } or Class name
| {{d0, v0}, {d1, v1}, ... } or Class name
| none
| none
|
|
* array of points & corresponding amplitude multipliers or class name defined in [[Arma 3 Sound: Sound Curves|cfgSoundCurves]]
* array of points & corresponding amplitude multipliers or class name defined in [[Arma 3: Sound: Sound Curves|cfgSoundCurves]]
* if shader is not used in submix (meaning it is the only one SoundShader in SoundSet), this parameter is currently ignored
* if shader is not used in submix (meaning it is the only one SoundShader in SoundSet), this parameter is currently ignored


|-
|-
!''limitation''
! ''limitation''
| bool
| bool
| false
| false
Line 68: Line 67:
|}
|}


<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">class CfgSoundShaders
class CfgSoundShaders
{
{
class ACPC2_closeShot_SoundShader
class ACPC2_closeShot_SoundShader
Line 78: Line 76:
{ "A3\Sounds_F\arsenal\weapons\Pistols\Acpc2\ACPC2_closeShot_02", 1 },
{ "A3\Sounds_F\arsenal\weapons\Pistols\Acpc2\ACPC2_closeShot_02", 1 },
{ "A3\Sounds_F\arsenal\weapons\Pistols\Acpc2\ACPC2_closeShot_03", 2 } // example: sample has a higher chance of being picked
{ "A3\Sounds_F\arsenal\weapons\Pistols\Acpc2\ACPC2_closeShot_03", 2 } // example: sample has a higher chance of being picked
};
};
volume = db3; // additional gain, +3dB
volume = db3; // additional gain, +3dB
range = 50;
range = 50;

Latest revision as of 10:38, 6 May 2024

SoundShader

SoundShader is the lowest level of sound configuration. It contains the definition of sound files and basic set of parameters.

All SoundShaders have to be defined in the base class CfgSoundShaders.

For single SoundShader (SoundSet respectively), use sound files with the same sampling rate.
Parameter Unit/values Default Description
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
  • probability values are normalized to 1, in every case there is one sample selected
  • no immediate repeat (engine never selects the same sample twice in a row)
volume float (0..n) or [dBFS] 1 (= db0)
  • base volume value
  • use format dbx for decibels in dBFS (e.g. db-6 for -6 dBFS)
  • use float number to specify amplitude value directly
frequency (0.5..2) 1
  • base pitch value, 1 = no change
  • if shader is used in submix (more than one SoundShader in SoundSet), this parameter is currently ignored
range (0..n) [m] 0
  • radius of sphere (with center on sound source position) where sound is playing
rangeCurve {{d0, v0}, {d1, v1}, ... } or Class name none
  • array of points & corresponding amplitude multipliers or class name defined in cfgSoundCurves
  • if shader is not used in submix (meaning it is the only one SoundShader in SoundSet), this parameter is currently ignored
limitation bool false
  • adds SoundShader to the group of SoundShaders, where number of simultaneously playing SoundShaders will be limited (within single SoundSet)
class CfgSoundShaders
{
	class ACPC2_closeShot_SoundShader
	{
		samples[] = 
		{
			{ "A3\Sounds_F\arsenal\weapons\Pistols\Acpc2\ACPC2_closeShot_01", 1 },
			{ "A3\Sounds_F\arsenal\weapons\Pistols\Acpc2\ACPC2_closeShot_02", 1 },
			{ "A3\Sounds_F\arsenal\weapons\Pistols\Acpc2\ACPC2_closeShot_03", 2 } // example: sample has a higher chance of being picked
		};
		volume = db3; // additional gain, +3dB
		range = 50;
		rangeCurve = closeShotCurve; //classname of a curve, defined in cfgSoundCurves
};