The guild ID this listener is connected to (empty if not connected).
Whether the audio listener is currently connected.
Current set of net IDs being listened to.
Add a net to listen on (without reconnecting). Calls the assignments API to assign the service listener to the net.
Connect to the shard and start receiving audio.
Connection options including guildId and initial nets.
Remove a previously registered handler.
Register an event handler.
client.audio.on("audio", (frame) => { ... });
client.audio.on("ptt.start", (evt) => { ... });
client.audio.on("ptt.stop", (evt) => { ... });
client.audio.on("connected", (data) => { ... });
client.audio.on("disconnected", ({ reason }) => { ... });
client.audio.on("reconnected", ({ attempt }) => { ... });
client.audio.on("error", ({ reason }) => { ... });
Remove a net from listening (without reconnecting). Calls the assignments API to unassign the service listener from the net.
Stop the audio listener. Unassigns from all nets and closes the WebSocket. Will not trigger reconnection.
Listen-only voice audio resource.
Opens a dedicated WebSocket to the shard in
serviceListenmode, receives Opus audio frames and PTT events, and supports dynamic net add/remove without reconnecting.Example