@@ -3,7 +3,7 @@ using System.Threading;
namespace Discord.WebSockets.Voice
namespace Discord.WebSockets.Voice
{
{
public class VoiceBuffer
internal class VoiceBuffer : IDiscord VoiceBuffer
{
{
public int FrameSize => _frameSize;
public int FrameSize => _frameSize;
public int FrameCount => _frameCount;
public int FrameCount => _frameCount;
@@ -17,7 +17,7 @@ namespace Discord.WebSockets.Voice
private ManualResetEventSlim _underflowEvent, _notOverflowEvent;
private ManualResetEventSlim _underflowEvent, _notOverflowEvent;
private bool _isClearing;
private bool _isClearing;
internal VoiceBuffer(int frameCount, int frameSize)
public VoiceBuffer(int frameCount, int frameSize)
{
{
_frameSize = frameSize;
_frameSize = frameSize;
_frameCount = frameCount;
_frameCount = frameCount;
@@ -30,7 +30,7 @@ namespace Discord.WebSockets.Voice
_notOverflowEvent = new ManualResetEventSlim(); //Notifies when an overflow is solved
_notOverflowEvent = new ManualResetEventSlim(); //Notifies when an overflow is solved
}
}
internal void Push(byte[] buffer, int bytes, CancellationToken cancelToken)
public void Push(byte[] buffer, int bytes, CancellationToken cancelToken)
{
{
int wholeFrames = bytes / _frameSize;
int wholeFrames = bytes / _frameSize;
int expectedBytes = wholeFrames * _frameSize;
int expectedBytes = wholeFrames * _frameSize;
@@ -74,7 +74,7 @@ namespace Discord.WebSockets.Voice
}
}
}
}
internal bool Pop(byte[] buffer)
public bool Pop(byte[] buffer)
{
{
if (_writeCursor == _readCursor)
if (_writeCursor == _readCursor)
{
{
@@ -93,7 +93,7 @@ namespace Discord.WebSockets.Voice
return !isClearing;
return !isClearing;
}
}
internal void Clear(CancellationToken cancelToken)
public void Clear(CancellationToken cancelToken)
{
{
lock (this)
lock (this)
{
{
@@ -107,7 +107,7 @@ namespace Discord.WebSockets.Voice
}
}
}
}
internal void Wait(CancellationToken cancelToken)
public void Wait(CancellationToken cancelToken)
{
{
_underflowEvent.Wait(cancelToken);
_underflowEvent.Wait(cancelToken);
}
}