Class VoiceClient<Platform, MSC>

Type Parameters

Hierarchy

Constructors

  • The base voice client. It's recommended to use the platform-specific clients instead.

    Type Parameters

    Parameters

    • platform: Platform
    • client: VoiceClientOptions | Client
    • msc: Platform extends "node" ? __module : __module

      The MediaSoup client to use. (for tree-shaking)

    • createDevice: (() => MSC["Device"])

      A function called to create a new MediaSoup Device for the client.

        • (): MSC["Device"]
        • Returns MSC["Device"]

    • Optional consumeTrack: VoiceClientConsumer<Platform>

      A callback that is run to play a new MediaStreamTrack. The function returned will be called when the stream is closed. (leave out to disable consuming media)

    Returns VoiceClient<Platform, MSC>

Properties

_deafened: boolean = false
audioProducer?: MSC["Producer"]
channelID: null | string = null
client: Client = ...
consumeTrack?: VoiceClientConsumer<Platform>

A callback that is run to play a new MediaStreamTrack. The function returned will be called when the stream is closed. (leave out to disable consuming media)

consumers: Map<string, VoiceConsumer<Platform>> = ...
createDevice: (() => MSC["Device"])

Type declaration

    • (): MSC["Device"]
    • A function called to create a new MediaSoup Device for the client.

      Returns MSC["Device"]

device?: MSC["Device"]
msc: Platform extends "node" ? __module : __module

The MediaSoup client to use. (for tree-shaking)

participants: MiniMapEmitter<VoiceParticipant> = ...
platform: Platform
recvTransport: null | MSC["Transport"] = null
sendTransport: null | MSC["Transport"] = null
sessionDetails: null | {
    token: string;
    type: "user" | "bot";
} = null
signaling: default<Platform> = ...
status: VoiceStatus = VoiceStatus.UNLOADED
supported: boolean = false
prefixed: string | boolean

Accessors

Methods

  • Connect to a channel.

    Returns

    Itself.

    Parameters

    • channelResolvable: string | VoiceChannel | DMChannel | GroupDMChannel

    Returns Promise<undefined | VoiceClient<Platform, MSC>>

  • Parameters

    • address: string
    • roomId: string

    Returns Promise<void>

  • Return an array listing the events for which the emitter has registered listeners.

    Returns (keyof VoiceClientEvents)[]

  • Return the number of listeners listening to a given event.

    Parameters

    Returns number

  • Parameters

    • userId: string
    • type: "audio"

    Returns Promise<void>

  • Deafens yourself and stops consuming audio from participants.

    Returns Promise<void>

  • Parameters

    • type: "audio"
    • track: MSC["MediaStreamTrack"]

    Returns Promise<void>

  • Parameters

    • userId: string
    • Optional type: "audio"

    Returns Promise<void>

  • Undeafens yourself and restarts consuming audio from participants.

    Returns Promise<void>