(df9b1966f) Added an option to disable directional voice chat. Closes #1414

This commit is contained in:
Joonas Rikkonen
2019-04-10 13:27:30 +03:00
parent 74da38bd10
commit 593d99ec38
11 changed files with 78 additions and 74 deletions
@@ -32,6 +32,9 @@ namespace Barotrauma.Sounds
public bool UseRadioFilter;
public bool UseMuffleFilter;
public float Near { get; private set; }
public float Far { get; private set; }
private static BiQuad[] muffleFilters = new BiQuad[]
{
new LowpassFilter(VoipConfig.FREQUENCY, 800)
@@ -41,6 +44,16 @@ namespace Barotrauma.Sounds
new BandpassFilter(VoipConfig.FREQUENCY, 2000)
};
public float Gain
{
get { return soundChannel == null ? 0.0f : soundChannel.Gain; }
set
{
if (soundChannel == null) { return; }
soundChannel.Gain = value;
}
}
public VoipSound(SoundManager owner, VoipQueue q) : base(owner, "voip", true, true)
{
VoipConfig.SetupEncoding();
@@ -64,8 +77,8 @@ namespace Barotrauma.Sounds
public void SetRange(float near, float far)
{
soundChannel.Near = near;
soundChannel.Far = far;
soundChannel.Near = Near = near;
soundChannel.Far = Far = far;
}
public void ApplyFilters(short[] buffer, int readSamples)