Ryujinx/Ryujinx.Audio/AudioHelper.cs

32 lines
685 B
C#
Raw Normal View History

2018-06-13 21:02:14 +00:00
using System;
namespace Ryujinx.Audio
{
class AudioHelper
{
public byte GetHighNibble(byte Value)
{
return (byte)((Value >> 4) & 0xF);
}
public byte GetLowNibble(byte Value)
{
return (byte)(Value & 0xF);
}
public short Clamp16(int Value)
{
if (Value > short.MaxValue)
return short.MaxValue;
if (Value < short.MinValue)
return short.MinValue;
return (short)Value;
}
public int DivideByRoundUp(int Value, int Divisor)
{
2018-06-15 13:19:29 +00:00
return (Value + (Divisor - 1)) / Divisor;
2018-06-13 21:02:14 +00:00
}
}
}