Interface IAudioClient
Assembly: Discord.Net.Core.dll​
View Source​
public interface IAudioClient : IDisposable
Properties​
ConnectionState​
Gets the current connection state of this client.
View Source​
ConnectionState ConnectionState { get; }
Latency​
Gets the estimated round-trip latency, in milliseconds, to the voice WebSocket server.
View Source​
int Latency { get; }
UdpLatency​
Gets the estimated round-trip latency, in milliseconds, to the voice UDP server.
View Source​
int UdpLatency { get; }
Methods​
GetStreams()​
Gets the current audio streams.
View Source​
IReadOnlyDictionary<ulong, AudioInStream> GetStreams()
Returns​
System.Collections.Generic.IReadOnlyDictionary<System.UInt64,Discord.Audio.AudioInStream>
StopAsync()​
View Source​
Task StopAsync()
Returns​
System.Threading.Tasks.Task
SetSpeakingAsync(Boolean)​
View Source​
Task SetSpeakingAsync(bool value)
Returns​
System.Threading.Tasks.Task
Parameters​
Type | Name |
---|---|
System.Boolean | value |
CreateOpusStream(Int32)​
Creates a new outgoing stream accepting Opus-encoded data.
View Source​
AudioOutStream CreateOpusStream(int bufferMillis = 1000)
Returns​
Parameters​
Type | Name |
---|---|
System.Int32 | bufferMillis |
CreateDirectOpusStream()​
Creates a new outgoing stream accepting Opus-encoded data. This is a direct stream with no internal timer.
View Source​
AudioOutStream CreateDirectOpusStream()
Returns​
CreatePCMStream(AudioApplication, Nullable<Int32>, Int32, Int32)​
Creates a new outgoing stream accepting PCM (raw) data.
View Source​
AudioOutStream CreatePCMStream(AudioApplication application, int? bitrate = null, int bufferMillis = 1000, int packetLoss = 30)
Returns​
Parameters​
Type | Name |
---|---|
Discord.Audio.AudioApplication | application |
System.Nullable<System.Int32> | bitrate |
System.Int32 | bufferMillis |
System.Int32 | packetLoss |
CreateDirectPCMStream(AudioApplication, Nullable<Int32>, Int32)​
Creates a new direct outgoing stream accepting PCM (raw) data. This is a direct stream with no internal timer.
View Source​
AudioOutStream CreateDirectPCMStream(AudioApplication application, int? bitrate = null, int packetLoss = 30)
Returns​
Parameters​
Type | Name |
---|---|
Discord.Audio.AudioApplication | application |
System.Nullable<System.Int32> | bitrate |
System.Int32 | packetLoss |
Events​
Connected​
View Source​
event Func<Task> Connected
Event Type​
System.Func<System.Threading.Tasks.Task>
Disconnected​
View Source​
event Func<Exception, Task> Disconnected
Event Type​
System.Func<System.Exception,System.Threading.Tasks.Task>
LatencyUpdated​
View Source​
event Func<int, int, Task> LatencyUpdated
Event Type​
System.Func<System.Int32,System.Int32,System.Threading.Tasks.Task>
UdpLatencyUpdated​
View Source​
event Func<int, int, Task> UdpLatencyUpdated
Event Type​
System.Func<System.Int32,System.Int32,System.Threading.Tasks.Task>
StreamCreated​
View Source​
event Func<ulong, AudioInStream, Task> StreamCreated
Event Type​
System.Func<System.UInt64,Discord.Audio.AudioInStream,System.Threading.Tasks.Task>
StreamDestroyed​
View Source​
event Func<ulong, Task> StreamDestroyed
Event Type​
System.Func<System.UInt64,System.Threading.Tasks.Task>
SpeakingUpdated​
View Source​
event Func<ulong, bool, Task> SpeakingUpdated
Event Type​
System.Func<System.UInt64,System.Boolean,System.Threading.Tasks.Task>