# social.colibri.beta.voice.defs

> Published by [colibri.social](https://lexicon.garden/identity/did:plc:mprdjqjluoswa7awzggaggj3)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.voice.defs)
- [Documentation](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.voice.defs/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.voice.defs/examples)

## Definitions

### `social.colibri.beta.voice.defs#ack`

**Type**: `object`

Answers a heartbeat.

| Property | Type | Required | Description |
|----------|------|----------|-------------|

### `social.colibri.beta.voice.defs#join`

**Type**: `object`

Joins a voice channel. A connection must join before sending any other frame, and joining a second channel leaves the first.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `channel` | `string` (space-ref) | Yes | The voice channel to join. |

### `social.colibri.beta.voice.defs#error`

**Type**: `object`

Something the client sent could not be acted on.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `error` | `string` | Yes | Error name. |
| `message` | `string` | No | Human-readable detail. |

### `social.colibri.beta.voice.defs#leave`

**Type**: `object`

Leaves the voice channel this connection is joined to.

| Property | Type | Required | Description |
|----------|------|----------|-------------|

### `social.colibri.beta.voice.defs#joined`

**Type**: `object`

Confirms this connection has joined a voice channel.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `channel` | `string` (space-ref) | Yes | The voice channel now joined. |

### `social.colibri.beta.voice.defs#consume`

**Type**: `object`

Starts consuming another peer's producer on a receive transport this connection created.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `producerId` | `string` | Yes | The producer to consume. |
| `transportId` | `string` | Yes | The receive transport to consume on. |
| `rtpCapabilities` | `unknown` | Yes | This connection's opaque mediasoup RTP capabilities blob. |

### `social.colibri.beta.voice.defs#produce`

**Type**: `object`

Starts producing media on a send transport this connection created.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `kind` | `string` | Yes | The media kind. |
| `source` | `string` | Yes | What this producer captures. |
| `transportId` | `string` | Yes | The send transport to produce on. |
| `rtpParameters` | `unknown` | Yes | The opaque mediasoup RTP parameters blob. |

### `social.colibri.beta.voice.defs#peerLeft`

**Type**: `object`

A peer left the voice channel this connection is in.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes | Who left. |

### `social.colibri.beta.voice.defs#heartbeat`

**Type**: `object`

Keeps the connection alive. The server answers with an ack.

| Property | Type | Required | Description |
|----------|------|----------|-------------|

### `social.colibri.beta.voice.defs#peerJoined`

**Type**: `object`

Another peer joined the voice channel this connection is in.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes | Who joined. |

### `social.colibri.beta.voice.defs#disconnected`

**Type**: `object`

The server removed this client from the voice channel. Sent only to the client it applies to.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `reason` | `string` | No | Why it happened. |

### `social.colibri.beta.voice.defs#producerInfo`

**Type**: `object`

A media producer available to consume.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes | Who is producing this media. |
| `kind` | `string` | Yes | The media kind. |
| `paused` | `boolean` | No | Whether the producer is currently paused. |
| `source` | `string` | No | What the producer captures. |
| `producerId` | `string` | Yes | The producer's identifier. |

### `social.colibri.beta.voice.defs#setSelfState`

**Type**: `object`

Updates this connection's own mute or deafen state. An absent field leaves the current value unchanged.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `muted` | `boolean` | No | Whether the microphone is muted. |
| `deafened` | `boolean` | No | Whether incoming audio is silenced. |

### `social.colibri.beta.voice.defs#closeProducer`

**Type**: `object`

Closes a producer this connection owns.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `producerId` | `string` | Yes | The producer to close. |

### `social.colibri.beta.voice.defs#resumeConsumer`

**Type**: `object`

Resumes a consumer this connection created, which is created paused by default.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `consumerId` | `string` | Yes | The consumer to resume. |

### `social.colibri.beta.voice.defs#speakingUpdate`

**Type**: `object`

A change in whether someone is currently speaking.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes | Who this update is about. |
| `level` | `integer` | No | An audio level in dBFS. |
| `speaking` | `boolean` | Yes | Whether they are currently speaking. |

### `social.colibri.beta.voice.defs#consumerOptions`

**Type**: `object`

Parameters for consuming one producer.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes | The consumer's identifier. |
| `kind` | `string` | Yes | The media kind. |
| `producerId` | `string` | Yes | The producer being consumed. |
| `rtpParameters` | `unknown` | Yes | The opaque mediasoup RTP parameters blob. |

### `social.colibri.beta.voice.defs#createTransport`

**Type**: `object`

Requests a new WebRTC transport for the joined channel.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `direction` | `string` | Yes | Whether this transport will send or receive media. |

### `social.colibri.beta.voice.defs#producerRemoved`

**Type**: `object`

A peer's producer closed.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes | Whose producer this was. |
| `producerId` | `string` | Yes | The producer that closed. |

### `social.colibri.beta.voice.defs#rtpCapabilities`

**Type**: `object`

The RTP capabilities a WebRTC endpoint supports.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `payload` | `unknown` | No | The opaque mediasoup capability blob. |

### `social.colibri.beta.voice.defs#connectTransport`

**Type**: `object`

Completes DTLS negotiation for a transport this connection created.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `transportId` | `string` | Yes | The transport to connect. |
| `dtlsParameters` | `unknown` | Yes | The opaque mediasoup DTLS parameters blob. |

### `social.colibri.beta.voice.defs#transportOptions`

**Type**: `object`

Parameters for creating one side of a WebRTC transport.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes | The transport's identifier. |
| `direction` | `string` | No | Which side of the call this transport carries. |
| `iceCandidates` | `array` | Yes | The mediasoup ICE candidates, one opaque blob per candidate. This is an array, not a single object, because that is what a WebRTC transport hands back. |
| `iceParameters` | `unknown` | Yes | The opaque mediasoup ICE parameters blob. |
| `dtlsParameters` | `unknown` | Yes | The opaque mediasoup DTLS parameters blob. |

### `social.colibri.beta.voice.defs#moderationChanged`

**Type**: `object`

A peer's mute or deafen state changed, whether they did it themselves or a moderator did it to them.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes | Whose state changed. |
| `muted` | `boolean` | Yes | Whether the microphone is muted, for any reason. |
| `deafened` | `boolean` | Yes | Whether incoming audio is silenced, for any reason. |
| `serverMuted` | `boolean` | No | Whether a moderator muted them. When this is true the peer cannot unmute themselves. |
| `serverDeafened` | `boolean` | No | Whether a moderator deafened them. When this is true the peer cannot undeafen themselves. |

### `social.colibri.beta.voice.defs#getRtpCapabilities`

**Type**: `object`

Requests the router's RTP capabilities for the joined channel.

| Property | Type | Required | Description |
|----------|------|----------|-------------|

## Raw Schema

```json
{
  "id": "social.colibri.beta.voice.defs",
  "defs": {
    "ack": {
      "type": "object",
      "required": [],
      "properties": {},
      "description": "Answers a heartbeat."
    },
    "join": {
      "type": "object",
      "required": [
        "channel"
      ],
      "properties": {
        "channel": {
          "type": "string",
          "format": "space-ref",
          "description": "The voice channel to join."
        }
      },
      "description": "Joins a voice channel. A connection must join before sending any other frame, and joining a second channel leaves the first."
    },
    "error": {
      "type": "object",
      "required": [
        "error"
      ],
      "properties": {
        "error": {
          "type": "string",
          "description": "Error name.",
          "knownValues": [
            "InvalidFrame",
            "NotJoined",
            "ChannelNotFound",
            "NotVoiceChannel",
            "Forbidden",
            "NotFound"
          ]
        },
        "message": {
          "type": "string",
          "description": "Human-readable detail."
        }
      },
      "description": "Something the client sent could not be acted on."
    },
    "leave": {
      "type": "object",
      "required": [],
      "properties": {},
      "description": "Leaves the voice channel this connection is joined to."
    },
    "joined": {
      "type": "object",
      "required": [
        "channel"
      ],
      "properties": {
        "channel": {
          "type": "string",
          "format": "space-ref",
          "description": "The voice channel now joined."
        }
      },
      "description": "Confirms this connection has joined a voice channel."
    },
    "consume": {
      "type": "object",
      "required": [
        "transportId",
        "producerId",
        "rtpCapabilities"
      ],
      "properties": {
        "producerId": {
          "type": "string",
          "description": "The producer to consume."
        },
        "transportId": {
          "type": "string",
          "description": "The receive transport to consume on."
        },
        "rtpCapabilities": {
          "type": "unknown",
          "description": "This connection's opaque mediasoup RTP capabilities blob."
        }
      },
      "description": "Starts consuming another peer's producer on a receive transport this connection created."
    },
    "produce": {
      "type": "object",
      "required": [
        "transportId",
        "kind",
        "rtpParameters",
        "source"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "description": "The media kind.",
          "knownValues": [
            "audio",
            "video"
          ]
        },
        "source": {
          "type": "string",
          "description": "What this producer captures.",
          "knownValues": [
            "microphone",
            "camera",
            "screen"
          ]
        },
        "transportId": {
          "type": "string",
          "description": "The send transport to produce on."
        },
        "rtpParameters": {
          "type": "unknown",
          "description": "The opaque mediasoup RTP parameters blob."
        }
      },
      "description": "Starts producing media on a send transport this connection created."
    },
    "peerLeft": {
      "type": "object",
      "required": [
        "did"
      ],
      "properties": {
        "did": {
          "type": "string",
          "format": "did",
          "description": "Who left."
        }
      },
      "description": "A peer left the voice channel this connection is in."
    },
    "heartbeat": {
      "type": "object",
      "required": [],
      "properties": {},
      "description": "Keeps the connection alive. The server answers with an ack."
    },
    "peerJoined": {
      "type": "object",
      "required": [
        "did"
      ],
      "properties": {
        "did": {
          "type": "string",
          "format": "did",
          "description": "Who joined."
        }
      },
      "description": "Another peer joined the voice channel this connection is in."
    },
    "disconnected": {
      "type": "object",
      "required": [],
      "properties": {
        "reason": {
          "type": "string",
          "description": "Why it happened.",
          "knownValues": [
            "moderator",
            "superseded",
            "channelGone"
          ]
        }
      },
      "description": "The server removed this client from the voice channel. Sent only to the client it applies to."
    },
    "producerInfo": {
      "type": "object",
      "required": [
        "producerId",
        "did",
        "kind"
      ],
      "properties": {
        "did": {
          "type": "string",
          "format": "did",
          "description": "Who is producing this media."
        },
        "kind": {
          "type": "string",
          "description": "The media kind.",
          "knownValues": [
            "audio",
            "video"
          ]
        },
        "paused": {
          "type": "boolean",
          "description": "Whether the producer is currently paused."
        },
        "source": {
          "type": "string",
          "description": "What the producer captures.",
          "knownValues": [
            "microphone",
            "camera",
            "screen"
          ]
        },
        "producerId": {
          "type": "string",
          "description": "The producer's identifier."
        }
      },
      "description": "A media producer available to consume."
    },
    "setSelfState": {
      "type": "object",
      "required": [],
      "properties": {
        "muted": {
          "type": "boolean",
          "description": "Whether the microphone is muted."
        },
        "deafened": {
          "type": "boolean",
          "description": "Whether incoming audio is silenced."
        }
      },
      "description": "Updates this connection's own mute or deafen state. An absent field leaves the current value unchanged."
    },
    "closeProducer": {
      "type": "object",
      "required": [
        "producerId"
      ],
      "properties": {
        "producerId": {
          "type": "string",
          "description": "The producer to close."
        }
      },
      "description": "Closes a producer this connection owns."
    },
    "resumeConsumer": {
      "type": "object",
      "required": [
        "consumerId"
      ],
      "properties": {
        "consumerId": {
          "type": "string",
          "description": "The consumer to resume."
        }
      },
      "description": "Resumes a consumer this connection created, which is created paused by default."
    },
    "speakingUpdate": {
      "type": "object",
      "required": [
        "did",
        "speaking"
      ],
      "properties": {
        "did": {
          "type": "string",
          "format": "did",
          "description": "Who this update is about."
        },
        "level": {
          "type": "integer",
          "description": "An audio level in dBFS."
        },
        "speaking": {
          "type": "boolean",
          "description": "Whether they are currently speaking."
        }
      },
      "description": "A change in whether someone is currently speaking."
    },
    "consumerOptions": {
      "type": "object",
      "required": [
        "id",
        "producerId",
        "kind",
        "rtpParameters"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The consumer's identifier."
        },
        "kind": {
          "type": "string",
          "description": "The media kind.",
          "knownValues": [
            "audio",
            "video"
          ]
        },
        "producerId": {
          "type": "string",
          "description": "The producer being consumed."
        },
        "rtpParameters": {
          "type": "unknown",
          "description": "The opaque mediasoup RTP parameters blob."
        }
      },
      "description": "Parameters for consuming one producer."
    },
    "createTransport": {
      "type": "object",
      "required": [
        "direction"
      ],
      "properties": {
        "direction": {
          "type": "string",
          "description": "Whether this transport will send or receive media.",
          "knownValues": [
            "send",
            "recv"
          ]
        }
      },
      "description": "Requests a new WebRTC transport for the joined channel."
    },
    "producerRemoved": {
      "type": "object",
      "required": [
        "producerId",
        "did"
      ],
      "properties": {
        "did": {
          "type": "string",
          "format": "did",
          "description": "Whose producer this was."
        },
        "producerId": {
          "type": "string",
          "description": "The producer that closed."
        }
      },
      "description": "A peer's producer closed."
    },
    "rtpCapabilities": {
      "type": "object",
      "properties": {
        "payload": {
          "type": "unknown",
          "description": "The opaque mediasoup capability blob."
        }
      },
      "description": "The RTP capabilities a WebRTC endpoint supports."
    },
    "connectTransport": {
      "type": "object",
      "required": [
        "transportId",
        "dtlsParameters"
      ],
      "properties": {
        "transportId": {
          "type": "string",
          "description": "The transport to connect."
        },
        "dtlsParameters": {
          "type": "unknown",
          "description": "The opaque mediasoup DTLS parameters blob."
        }
      },
      "description": "Completes DTLS negotiation for a transport this connection created."
    },
    "transportOptions": {
      "type": "object",
      "required": [
        "id",
        "iceParameters",
        "iceCandidates",
        "dtlsParameters"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The transport's identifier."
        },
        "direction": {
          "type": "string",
          "description": "Which side of the call this transport carries.",
          "knownValues": [
            "send",
            "recv"
          ]
        },
        "iceCandidates": {
          "type": "array",
          "items": {
            "type": "unknown",
            "description": "One opaque mediasoup ICE candidate."
          },
          "description": "The mediasoup ICE candidates, one opaque blob per candidate. This is an array, not a single object, because that is what a WebRTC transport hands back."
        },
        "iceParameters": {
          "type": "unknown",
          "description": "The opaque mediasoup ICE parameters blob."
        },
        "dtlsParameters": {
          "type": "unknown",
          "description": "The opaque mediasoup DTLS parameters blob."
        }
      },
      "description": "Parameters for creating one side of a WebRTC transport."
    },
    "moderationChanged": {
      "type": "object",
      "required": [
        "did",
        "muted",
        "deafened"
      ],
      "properties": {
        "did": {
          "type": "string",
          "format": "did",
          "description": "Whose state changed."
        },
        "muted": {
          "type": "boolean",
          "description": "Whether the microphone is muted, for any reason."
        },
        "deafened": {
          "type": "boolean",
          "description": "Whether incoming audio is silenced, for any reason."
        },
        "serverMuted": {
          "type": "boolean",
          "description": "Whether a moderator muted them. When this is true the peer cannot unmute themselves."
        },
        "serverDeafened": {
          "type": "boolean",
          "description": "Whether a moderator deafened them. When this is true the peer cannot undeafen themselves."
        }
      },
      "description": "A peer's mute or deafen state changed, whether they did it themselves or a moderator did it to them."
    },
    "getRtpCapabilities": {
      "type": "object",
      "required": [],
      "properties": {},
      "description": "Requests the router's RTP capabilities for the joined channel."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
