(f417b026f) Fetched: Changes for playing video tutorial from local branch
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using Lidgren.Network;
|
||||
using Microsoft.Xna.Framework;
|
||||
using OpenTK.Audio.OpenAL;
|
||||
using System;
|
||||
using System.Linq;
|
||||
@@ -27,11 +26,6 @@ namespace Barotrauma.Networking
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public float Gain
|
||||
{
|
||||
get { return GameMain.Config?.MicrophoneVolume ?? 1.0f; }
|
||||
}
|
||||
|
||||
public DateTime LastEnqueueAudio;
|
||||
|
||||
@@ -75,7 +69,6 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
if (!GUIMessageBox.MessageBoxes.Any(mb => mb.UserData as string == "capturedevicenotfound"))
|
||||
{
|
||||
GUI.SettingsMenuOpen = false;
|
||||
new GUIMessageBox(TextManager.Get("Error"), TextManager.Get("VoipCaptureDeviceNotFound"))
|
||||
{
|
||||
UserData = "capturedevicenotfound"
|
||||
@@ -167,9 +160,8 @@ namespace Barotrauma.Networking
|
||||
double maxAmplitude = 0.0f;
|
||||
for (int i = 0; i < VoipConfig.BUFFER_SIZE; i++)
|
||||
{
|
||||
uncompressedBuffer[i] = (short)MathHelper.Clamp((uncompressedBuffer[i] * Gain), -short.MaxValue, short.MaxValue);
|
||||
double sampleVal = uncompressedBuffer[i] / (double)short.MaxValue;
|
||||
maxAmplitude = Math.Max(maxAmplitude, Math.Abs(sampleVal));
|
||||
double sampleVal = (double)uncompressedBuffer[i] / (double)short.MaxValue;
|
||||
maxAmplitude = Math.Max(maxAmplitude, Math.Abs(sampleVal));
|
||||
}
|
||||
double dB = Math.Min(20 * Math.Log10(maxAmplitude), 0.0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user