Skip to main content

Interface IAudioClient

Assembly: Discord.Net.Core.dll​
View Source​
Declaration
public interface IAudioClient : IDisposable

Properties​

ConnectionState​

Gets the current connection state of this client.

View Source​
Declaration
ConnectionState ConnectionState { get; }

Latency​

Gets the estimated round-trip latency, in milliseconds, to the voice WebSocket server.

View Source​
Declaration
int Latency { get; }

UdpLatency​

Gets the estimated round-trip latency, in milliseconds, to the voice UDP server.

View Source​
Declaration
int UdpLatency { get; }

Methods​

GetStreams()​

Gets the current audio streams.

View Source​
Declaration
IReadOnlyDictionary<ulong, AudioInStream> GetStreams()
Returns​

System.Collections.Generic.IReadOnlyDictionary<System.UInt64,Discord.Audio.AudioInStream>

StopAsync()​

View Source​
Declaration
Task StopAsync()
Returns​

System.Threading.Tasks.Task

SetSpeakingAsync(Boolean)​

View Source​
Declaration
Task SetSpeakingAsync(bool value)
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.Booleanvalue

CreateOpusStream(Int32)​

Creates a new outgoing stream accepting Opus-encoded data.

View Source​
Declaration
AudioOutStream CreateOpusStream(int bufferMillis = 1000)
Returns​

Discord.Audio.AudioOutStream

Parameters​
TypeName
System.Int32bufferMillis

CreateDirectOpusStream()​

Creates a new outgoing stream accepting Opus-encoded data. This is a direct stream with no internal timer.

View Source​
Declaration
AudioOutStream CreateDirectOpusStream()
Returns​

Discord.Audio.AudioOutStream

CreatePCMStream(AudioApplication, Nullable<Int32>, Int32, Int32)​

Creates a new outgoing stream accepting PCM (raw) data.

View Source​
Declaration
AudioOutStream CreatePCMStream(AudioApplication application, int? bitrate = null, int bufferMillis = 1000, int packetLoss = 30)
Returns​

Discord.Audio.AudioOutStream

Parameters​
TypeName
Discord.Audio.AudioApplicationapplication
System.Nullable<System.Int32>bitrate
System.Int32bufferMillis
System.Int32packetLoss

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​
Declaration
AudioOutStream CreateDirectPCMStream(AudioApplication application, int? bitrate = null, int packetLoss = 30)
Returns​

Discord.Audio.AudioOutStream

Parameters​
TypeName
Discord.Audio.AudioApplicationapplication
System.Nullable<System.Int32>bitrate
System.Int32packetLoss

Events​

Connected​

View Source​
Declaration
event Func<Task> Connected
Event Type​

System.Func<System.Threading.Tasks.Task>

Disconnected​

View Source​
Declaration
event Func<Exception, Task> Disconnected
Event Type​

System.Func<System.Exception,System.Threading.Tasks.Task>

LatencyUpdated​

View Source​
Declaration
event Func<int, int, Task> LatencyUpdated
Event Type​

System.Func<System.Int32,System.Int32,System.Threading.Tasks.Task>

UdpLatencyUpdated​

View Source​
Declaration
event Func<int, int, Task> UdpLatencyUpdated
Event Type​

System.Func<System.Int32,System.Int32,System.Threading.Tasks.Task>

StreamCreated​

View Source​
Declaration
event Func<ulong, AudioInStream, Task> StreamCreated
Event Type​

System.Func<System.UInt64,Discord.Audio.AudioInStream,System.Threading.Tasks.Task>

StreamDestroyed​

View Source​
Declaration
event Func<ulong, Task> StreamDestroyed
Event Type​

System.Func<System.UInt64,System.Threading.Tasks.Task>

SpeakingUpdated​

View Source​
Declaration
event Func<ulong, bool, Task> SpeakingUpdated
Event Type​

System.Func<System.UInt64,System.Boolean,System.Threading.Tasks.Task>