Search Results for

    Show / Hide Table of Contents

    Class VoiceNextConnection

    VoiceNext connection to a voice channel.

    Inheritance
    System.Object
    VoiceNextConnection
    Namespace: DisCatSharp.VoiceNext
    Assembly: DisCatSharp.VoiceNext.dll
    Syntax
    public sealed class VoiceNextConnection : IDisposable

    Properties

    | Improve this Doc View Source

    AudioFormat

    Gets the audio format used by the Opus encoder.

    Declaration
    public AudioFormat AudioFormat { get; }
    Property Value
    Type Description
    AudioFormat
    | Improve this Doc View Source

    IsPlaying

    Gets whether this connection is still playing audio.

    Declaration
    public bool IsPlaying { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    TargetChannel

    Gets the channel this voice client is connected to.

    Declaration
    public DiscordChannel TargetChannel { get; }
    Property Value
    Type Description
    DiscordChannel
    | Improve this Doc View Source

    UdpPing

    Gets the UDP round-trip time in ms.

    Declaration
    public int UdpPing { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    WebSocketPing

    Gets the websocket round-trip time in ms.

    Declaration
    public int WebSocketPing { get; }
    Property Value
    Type Description
    System.Int32

    Methods

    | Improve this Doc View Source

    Disconnect()

    Disconnects and disposes this voice connection.

    Declaration
    public void Disconnect()
    | Improve this Doc View Source

    Dispose()

    Disconnects and disposes this voice connection.

    Declaration
    public void Dispose()
    | Improve this Doc View Source

    Finalize()

    Declaration
    protected void Finalize()
    | Improve this Doc View Source

    GetTransmitSink(Int32)

    Gets a transmit stream for this connection, optionally specifying a packet size to use with the stream. If a stream is already configured, it will return the existing one.

    Declaration
    public VoiceTransmitSink GetTransmitSink(int sampleDuration = 20)
    Parameters
    Type Name Description
    System.Int32 sampleDuration

    Duration, in ms, to use for audio packets.

    Returns
    Type Description
    VoiceTransmitSink

    Transmit stream.

    | Improve this Doc View Source

    Pause()

    Pauses playback.

    Declaration
    public void Pause()
    | Improve this Doc View Source

    ResumeAsync()

    Asynchronously resumes playback.

    Declaration
    public async Task ResumeAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task
    | Improve this Doc View Source

    SendSpeakingAsync(Boolean)

    Sends a speaking status to the connected voice channel.

    Declaration
    public async Task SendSpeakingAsync(bool speaking = true)
    Parameters
    Type Name Description
    System.Boolean speaking

    Whether the current user is speaking or not.

    Returns
    Type Description
    System.Threading.Tasks.Task

    A task representing the sending operation.

    | Improve this Doc View Source

    WaitForPlaybackFinishAsync()

    Asynchronously waits for playback to be finished. Playback is finished when speaking = false is signaled.

    Declaration
    public async Task WaitForPlaybackFinishAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    A task representing the waiting operation.

    Events

    | Improve this Doc View Source

    UserJoined

    Triggered whenever a user joins voice in the connected guild.

    Declaration
    public event AsyncEventHandler<VoiceNextConnection, VoiceUserJoinEventArgs> UserJoined
    Event Type
    Type Description
    AsyncEventHandler<VoiceNextConnection, VoiceUserJoinEventArgs>
    | Improve this Doc View Source

    UserLeft

    Triggered whenever a user leaves voice in the connected guild.

    Declaration
    public event AsyncEventHandler<VoiceNextConnection, VoiceUserLeaveEventArgs> UserLeft
    Event Type
    Type Description
    AsyncEventHandler<VoiceNextConnection, VoiceUserLeaveEventArgs>
    | Improve this Doc View Source

    UserSpeaking

    Triggered whenever a user speaks in the connected voice channel.

    Declaration
    public event AsyncEventHandler<VoiceNextConnection, UserSpeakingEventArgs> UserSpeaking
    Event Type
    Type Description
    AsyncEventHandler<VoiceNextConnection, UserSpeakingEventArgs>
    | Improve this Doc View Source

    VoiceReceived

    Triggered whenever voice data is received from the connected voice channel.

    Declaration
    public event AsyncEventHandler<VoiceNextConnection, VoiceReceiveEventArgs> VoiceReceived
    Event Type
    Type Description
    AsyncEventHandler<VoiceNextConnection, VoiceReceiveEventArgs>
    | Improve this Doc View Source

    VoiceSocketErrored

    Triggered whenever voice WebSocket throws an exception.

    Declaration
    public event AsyncEventHandler<VoiceNextConnection, SocketErrorEventArgs> VoiceSocketErrored
    Event Type
    Type Description
    AsyncEventHandler<VoiceNextConnection, SocketErrorEventArgs>

    Extension Methods

    ReflectionUtilities.ToDictionary<T>(T)
    • Improve this Doc
    • View Source
    In This Article
    Back to top © 2021-2022 Aiko IT Systems