Added support for partial PCM frames

This commit is contained in:
RogueException
2016-12-30 16:02:01 -04:00
parent c38a786039
commit 3b72d48950
5 changed files with 49 additions and 28 deletions

View File

@@ -21,31 +21,27 @@ namespace Discord.Audio
/// Creates a new outgoing stream accepting Opus-encoded data.
/// </summary>
/// <param name="samplesPerFrame">Samples per frame. Must be 120, 240, 480, 960, 1920 or 2880, representing 2.5, 5, 10, 20, 40 or 60 milliseconds respectively.</param>
/// <param name="bufferSize">The size of the internal buffer used for encryption.</param>
/// <returns></returns>
Stream CreateOpusStream(int samplesPerFrame, int bufferSize = 4000);
Stream CreateOpusStream(int samplesPerFrame);
/// <summary>
/// Creates a new outgoing stream accepting Opus-encoded data. This is a direct stream with no internal timer.
/// </summary>
/// <param name="samplesPerFrame">Samples per frame. Must be 120, 240, 480, 960, 1920 or 2880, representing 2.5, 5, 10, 20, 40 or 60 milliseconds respectively.</param>
/// <param name="bufferSize">The size of the internal buffer used for encryption.</param>
/// <returns></returns>
Stream CreateDirectOpusStream(int samplesPerFrame, int bufferSize = 4000);
Stream CreateDirectOpusStream(int samplesPerFrame);
/// <summary>
/// Creates a new outgoing stream accepting PCM (raw) data.
/// </summary>
/// <param name="samplesPerFrame">Samples per frame. Must be 120, 240, 480, 960, 1920 or 2880, representing 2.5, 5, 10, 20, 40 or 60 milliseconds respectively.</param>
/// <param name="bitrate"></param>
/// <param name="bufferSize">The size of the internal buffer used for encoding and encryption.</param>
/// <returns></returns>
Stream CreatePCMStream(int samplesPerFrame, int? bitrate = null, int bufferSize = 4000);
Stream CreatePCMStream(int samplesPerFrame, int channels = 2, int? bitrate = null);
/// <summary>
/// Creates a new direct outgoing stream accepting PCM (raw) data. This is a direct stream with no internal timer.
/// </summary>
/// <param name="samplesPerFrame">Samples per frame. Must be 120, 240, 480, 960, 1920 or 2880, representing 2.5, 5, 10, 20, 40 or 60 milliseconds respectively.</param>
/// <param name="bitrate"></param>
/// <param name="bufferSize">The size of the internal buffer used for encoding and encryption.</param>
/// <returns></returns>
Stream CreateDirectPCMStream(int samplesPerFrame, int? bitrate = null, int bufferSize = 4000);
Stream CreateDirectPCMStream(int samplesPerFrame, int channels = 2, int? bitrate = null);
}
}