v1.5.7.0 (Summer Update)

This commit is contained in:
Regalis11
2024-06-18 16:49:51 +03:00
parent 4a63dacbce
commit 230d1b6e78
263 changed files with 7792 additions and 2845 deletions
@@ -137,22 +137,10 @@ namespace Barotrauma.Sounds
{
for (int i = 0; i < length; i++)
{
outBuffer[i] = FloatToShort(inBuffer[i]);
outBuffer[i] = ToolBox.FloatToShortAudioSample(inBuffer[i]);
}
}
static protected short FloatToShort(float fVal)
{
int temp = (int)(32767 * fVal);
if (temp > short.MaxValue) temp = short.MaxValue;
else if (temp < short.MinValue) temp = short.MinValue;
return (short)temp;
}
static protected float ShortToFloat(short shortVal)
{
return shortVal / 32767f;
}
public abstract int FillStreamBuffer(int samplePos, short[] buffer);
public abstract float GetAmplitudeAtPlaybackPos(int playbackPos);