Table of Contents

Interface IAudioClient

Namespace
Discord.Audio
Assembly
Discord.Net.Core.dll
public interface IAudioClient : IDisposable
Inherited Members

Properties

ConnectionState

Gets the current connection state of this client.

ConnectionState ConnectionState { get; }

Property Value

ConnectionState

Latency

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

int Latency { get; }

Property Value

int

UdpLatency

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

int UdpLatency { get; }

Property Value

int

Methods

CreateDirectOpusStream()

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

AudioOutStream CreateDirectOpusStream()

Returns

AudioOutStream

CreateDirectPCMStream(AudioApplication, int?, int)

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)

Parameters

application AudioApplication
bitrate int?
packetLoss int

Returns

AudioOutStream

CreateOpusStream(int)

Creates a new outgoing stream accepting Opus-encoded data.

AudioOutStream CreateOpusStream(int bufferMillis = 1000)

Parameters

bufferMillis int

Returns

AudioOutStream

CreatePCMStream(AudioApplication, int?, int, int)

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

AudioOutStream CreatePCMStream(AudioApplication application, int? bitrate = null, int bufferMillis = 1000, int packetLoss = 30)

Parameters

application AudioApplication
bitrate int?
bufferMillis int
packetLoss int

Returns

AudioOutStream

GetStreams()

Gets the current audio streams.

IReadOnlyDictionary<ulong, AudioInStream> GetStreams()

Returns

IReadOnlyDictionary<ulong, AudioInStream>

SetSpeakingAsync(bool)

Task SetSpeakingAsync(bool value)

Parameters

value bool

Returns

Task

StopAsync()

Task StopAsync()

Returns

Task

Events

ClientDisconnected

event Func<ulong, Task> ClientDisconnected

Event Type

Func<ulong, Task>

Connected

event Func<Task> Connected

Event Type

Func<Task>

Disconnected

event Func<Exception, Task> Disconnected

Event Type

Func<Exception, Task>

LatencyUpdated

event Func<int, int, Task> LatencyUpdated

Event Type

Func<int, int, Task>

SpeakingUpdated

event Func<ulong, bool, Task> SpeakingUpdated

Event Type

Func<ulong, bool, Task>

StreamCreated

event Func<ulong, AudioInStream, Task> StreamCreated

Event Type

Func<ulong, AudioInStream, Task>

StreamDestroyed

event Func<ulong, Task> StreamDestroyed

Event Type

Func<ulong, Task>

UdpLatencyUpdated

event Func<int, int, Task> UdpLatencyUpdated

Event Type

Func<int, int, Task>