| @@ -12,8 +12,8 @@ namespace Discord.Audio | |||||
| public const int SampleBytes = sizeof(short) * Channels; | public const int SampleBytes = sizeof(short) * Channels; | ||||
| public const int FrameSamples = SamplingRate / 1000 * FrameMillis; | |||||
| public const int FrameSamplesPerChannel = SamplingRate / 1000 * FrameMillis; | public const int FrameSamplesPerChannel = SamplingRate / 1000 * FrameMillis; | ||||
| public const int FrameSamples = FrameSamplesPerChannel * Channels; | |||||
| public const int FrameBytes = FrameSamples * SampleBytes; | public const int FrameBytes = FrameSamples * SampleBytes; | ||||
| protected bool _isDisposed = false; | protected bool _isDisposed = false; | ||||
| @@ -25,9 +25,9 @@ namespace Discord.Audio | |||||
| int result = 0; | int result = 0; | ||||
| fixed (byte* inPtr = input) | fixed (byte* inPtr = input) | ||||
| fixed (byte* outPtr = output) | fixed (byte* outPtr = output) | ||||
| result = Decode(_ptr, inPtr + inputOffset, inputCount, outPtr + outputOffset, FrameBytes / SampleBytes, 1); | |||||
| result = Decode(_ptr, inPtr + inputOffset, inputCount, outPtr + outputOffset, FrameSamplesPerChannel, 1); | |||||
| CheckError(result); | CheckError(result); | ||||
| return FrameBytes; | |||||
| return result * SampleBytes; | |||||
| } | } | ||||
| protected override void Dispose(bool disposing) | protected override void Dispose(bool disposing) | ||||