Skip to content

voice_leave

Leave your current voice channel. Close your peer-to-peer audio connections too; the server doesn’t do that for you.

{
"cmd": "voice_leave"
}

No fields besides cmd. The server knows which channel this connection is in.

{
"cmd": "voice_leave",
"channel": "hangout"
}

When anyone leaves, the server sends this to every connection whose user can view the channel, including the leaver’s own connections:

{
"cmd": "voice_user_left",
"channel": "hangout",
"username": "carol"
}

The event has username but no user ID. Users severed from the leaver don’t get it. It arrives before the voice_leave response.

The server also sends voice_user_left when:

  • a connection closes while in voice, for any reason;
  • a connection joins a different channel with voice_join;
  • a moderator severs two users who are in the same voice channel. Each of the two gets a voice_user_left naming the other, on all their connections. Nobody else gets it, and both stay in the channel on the server. Drop your connection to that peer.

Any joined member can call it, including users in timeout.

val When
You are not in a voice channel This connection isn’t in voice.
Voice channel no longer exists The channel you were in has no participants on record, for example because it was deleted.
You are not in this voice channel The server has no record of your account in the channel.
This voice connection is no longer active Your account’s voice session in this channel belongs to a different peer ID, for example after rejoining elsewhere.

After any of these errors the server forgets this connection’s voice channel, so you can call voice_join again.