using System; using System.Threading.Tasks; namespace Discord.Audio { public interface IAudioClient : IDisposable { event Func Connected; event Func Disconnected; event Func LatencyUpdated; event Func UdpLatencyUpdated; event Func StreamCreated; event Func StreamDestroyed; event Func SpeakingUpdated; /// Gets the current connection state of this client. ConnectionState ConnectionState { get; } /// Gets the estimated round-trip latency, in milliseconds, to the voice WebSocket server. int Latency { get; } /// Gets the estimated round-trip latency, in milliseconds, to the voice UDP server. int UdpLatency { get; } Task StopAsync(); Task SetSpeakingAsync(bool value); /// Creates a new outgoing stream accepting Opus-encoded data. AudioOutStream CreateOpusStream(int bufferMillis = 1000); /// Creates a new outgoing stream accepting Opus-encoded data. This is a direct stream with no internal timer. AudioOutStream CreateDirectOpusStream(); /// Creates a new outgoing stream accepting PCM (raw) data. AudioOutStream CreatePCMStream(AudioApplication application, int? bitrate = null, int bufferMillis = 1000, int packetLoss = 30); /// Creates a new direct outgoing stream accepting PCM (raw) data. This is a direct stream with no internal timer. AudioOutStream CreateDirectPCMStream(AudioApplication application, int? bitrate = null, int packetLoss = 30); } }