export declare class Networking extends EventEmitterManages the networking required to maintain a voice connection and dispatch audio packets
Constructors
constructor(connectionOptions: ConnectionOptionsoptions: NetworkingOptions)
connectionOptions: ConnectionOptions
options: NetworkingOptions
Creates a new Networking instance.
state : NetworkingState
The current state of the networking instance.
destroy() : void
Destroys the Networking instance, transitioning it into the Closed state.
dispatchAudio() : boolean
Dispatches the audio packet previously prepared by prepareAudioPacket(opusPacket). The audio packet is consumed and cannot be dispatched again.
Prepares an Opus packet for playback. This includes attaching metadata to it and encrypting it. It will be stored within the instance, and can be played by dispatchAudio()
Returns: The audio packet that was prepared
Sends a packet to the voice gateway indicating that the client has start/stopped sending audio.