v1.5.7.0 (Summer Update)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user