Concrete class prototype
This commit is contained in:
23
src/Discord.Net.Core/Audio/IAudioClient.cs
Normal file
23
src/Discord.Net.Core/Audio/IAudioClient.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Discord.Audio
|
||||
{
|
||||
public interface IAudioClient
|
||||
{
|
||||
event Func<Task> Connected;
|
||||
event Func<Exception, Task> Disconnected;
|
||||
event Func<int, int, Task> LatencyUpdated;
|
||||
|
||||
/// <summary> Gets the current connection state of this client. </summary>
|
||||
ConnectionState ConnectionState { get; }
|
||||
/// <summary> Gets the estimated round-trip latency, in milliseconds, to the gateway server. </summary>
|
||||
int Latency { get; }
|
||||
|
||||
Task DisconnectAsync();
|
||||
|
||||
Stream CreateOpusStream(int samplesPerFrame, int bufferSize = 4000);
|
||||
Stream CreatePCMStream(int samplesPerFrame, int? bitrate = null, OpusApplication application = OpusApplication.MusicOrMixed, int bufferSize = 4000);
|
||||
}
|
||||
}
|
||||
9
src/Discord.Net.Core/Audio/Opus/OpusApplication.cs
Normal file
9
src/Discord.Net.Core/Audio/Opus/OpusApplication.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Discord.Audio
|
||||
{
|
||||
public enum OpusApplication : int
|
||||
{
|
||||
Voice = 2048,
|
||||
MusicOrMixed = 2049,
|
||||
LowLatency = 2051
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user