Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp
8.5 KB
Raw Blame
---
# SPDX-License-Identifier: AGPL-3.0-or-later
title: Entrance sounds
description: Upload entrance sounds, assign them to scopes and play them in voice channels.
---

import RouteHeader from '@/components/RouteHeader.astro';

An entrance sound is a short audio clip that plays for everyone else in a voice channel when you join it. You upload clips into your own library, assign one to each scope, and ask Fluxer to [play](#play-entrance-sound) the chosen clip after you connect. Bot tokens can't call these routes.

## Clip limits

| Bound | Value |
| --- | --- |
| Clips per account | 8 |
| Decoded clip size | 1048576 bytes |
| Encoded upload size | 1398134 characters |
| Clip duration | 100 through 5200 milliseconds |
| Display name | 1 through 32 characters |

The `feature_voice_entrance_sounds` [limit key](/http-api/instance/#limit-keys) tells the Fluxer app whether to show entrance sounds, but these routes don't check it.

## Supported containers

Fluxer detects the container from the audio bytes and ignores the type in a `data:` URI prefix.

| Detected container | Extension | Content type |
| --- | --- | --- |
| MP3, MPEG | mp3 | audio/mpeg |
| Ogg | ogg | audio/ogg |
| MP4, QuickTime, AAC in MP4 | m4a | audio/mp4 |
| WAV | wav | audio/wav |

Fluxer stores the bytes as uploaded and doesn't transcode them.

## Entrance sound object

One audio clip in an account's library.

### Structure

| Field | Type | Description |
| --- | --- | --- |
| id | snowflake | The ID of the sound |
| name | string | The display name of the clip (1-32 characters) |
| hash | string | The content hash of the audio (16 hexadecimal characters) |
| extension | string | The stored extension, one of `mp3`, `ogg`, `m4a` and `wav` |
| content_type | string | The MIME type the clip is served with |
| duration_ms | integer | The duration in milliseconds (0-5200) |
| size_bytes | integer | The decoded size in bytes (0-1048576) |
| url | string | The CDN URL of the clip (no authentication needed) |
| created_at | ISO8601 timestamp | The time the clip was uploaded |

### Example

```json
{
  "id": "1501314428688998182",
  "name": "airhorn",
  "hash": "9f2c41ab77de0135",
  "extension": "mp3",
  "content_type": "audio/mpeg",
  "duration_ms": 1240,
  "size_bytes": 20416,
  "url": "https://cdn.example.com/entrance-sounds/1490000000000000000/9f2c41ab77de0135.mp3",
  "created_at": "2026-08-31T09:12:04.118Z"
}
```

## Entrance sound selection object

The clip assigned to one scope. A scope with no clip has no selection.

### Structure

| Field | Type | Description |
| --- | --- | --- |
| scope_id | string | The [scope](#entrance-sound-scopes) the selection applies to |
| sound_id | snowflake | The clip assigned to that scope |

## Entrance sound scopes

| Value | Description |
| --- | --- |
| global | Applies wherever no narrower scope is selected |
| guilds | Applies in guild voice channels |
| dms | Applies in direct message and group calls |
| `guild:{guild_id}` | Applies in one guild |

Your client picks the selection that fits the channel and sends its `sound_id` to [Play entrance sound](#play-entrance-sound).

## List entrance sounds

<RouteHeader method="GET" path="/v1/users/@me/entrance-sounds" />

Returns your library and its selections.

### Response body

| Field | Type | Description |
| --- | --- | --- |
| sounds | array[[entrance sound](#entrance-sound-object) object] | The clips the account owns |
| selections | array[[entrance sound selection](#entrance-sound-selection-object) object] | The scopes that have a clip assigned |

### Response

| Status | Body | Condition |
| --- | --- | --- |
| 200 | response body | The library was returned |

The rate limit is 30 requests per minute, on the `user:entrance_sound:list` bucket.

## Upload entrance sound

<RouteHeader method="POST" path="/v1/users/@me/entrance-sounds" />

Stores one clip in your library and returns the [entrance sound object](#entrance-sound-object). Assign it to a scope with [Set entrance sound selection](#set-entrance-sound-selection).

### JSON body

| Field | Type | Description |
| --- | --- | --- |
| name | string | The display name of the clip (1-32 characters) |
| audio | base64 string | The audio bytes, base64 encoded (1-1398134 characters) |

A `data:` URI prefix on `audio` is accepted and ignored.

### Validation

Every failure returns 400 `INVALID_FORM_BODY` with these codes.

| Failure | Code | Path |
| --- | --- | --- |
| The field is missing or an empty string | `INVALID_FORMAT` | name or audio |
| The name is blank after trimming or over 32 characters | `STRING_LENGTH_INVALID` | name |
| The encoded payload is empty or over 1398134 characters | `BASE64_LENGTH_INVALID` | audio |
| The payload is not valid base64 | `INVALID_BASE64_FORMAT` | audio |
| The library already has 8 clips | `ENTRANCE_SOUND_QUOTA_REACHED` | audio |
| The decoded bytes are over 1048576 bytes | `ENTRANCE_SOUND_SIZE_EXCEEDS_LIMIT` | audio |
| The container is not [supported](#supported-containers) or the duration can't be measured | `ENTRANCE_SOUND_INVALID_FORMAT` | audio |
| The duration is under 100 or over 5200 milliseconds | `ENTRANCE_SOUND_DURATION_EXCEEDS_LIMIT` | audio |
| The clip could not be stored | `FAILED_TO_UPLOAD_IMAGE` | audio |

### Response

| Status | Body | Condition |
| --- | --- | --- |
| 201 | [entrance sound](#entrance-sound-object) object | The clip was stored |
| 400 | [error response](/http-api/#error-response) | The name or audio fails [validation](#validation) |
| 403 | [error response](/http-api/#error-response) | `ACCOUNT_LIMITED` when the account is [limited](/http-api/users/#account-limitation) |

The rate limit is 5 requests per 5 minutes, on the `user:entrance_sound:upload` bucket.

## Rename entrance sound

<RouteHeader method="PATCH" path="/v1/users/@me/entrance-sounds/{sound_id}" />

Changes the display name of a clip and returns the updated [entrance sound object](#entrance-sound-object).

### JSON body

| Field | Type | Description |
| --- | --- | --- |
| name | string | The new display name (1-32 characters) |

### Response

| Status | Body | Condition |
| --- | --- | --- |
| 200 | [entrance sound](#entrance-sound-object) object | The clip was renamed |
| 400 | [error response](/http-api/#error-response) | `STRING_LENGTH_INVALID` for a bad name, or `ENTRANCE_SOUND_NOT_FOUND` when you don't own the clip |

The rate limit is 20 requests per minute, on the `user:entrance_sound:mutate` bucket.

## Delete entrance sound

<RouteHeader method="DELETE" path="/v1/users/@me/entrance-sounds/{sound_id}" />

Deletes a clip and clears every selection that pointed at it.

### Response

| Status | Body | Condition |
| --- | --- | --- |
| 204 | empty | The clip was deleted or didn't exist |

The rate limit is 20 requests per minute, on the `user:entrance_sound:mutate` bucket.

## Set entrance sound selection

<RouteHeader method="PUT" path="/v1/users/@me/entrance-sound-selections" />

Assigns one of your clips to a [scope](#entrance-sound-scopes) and replaces any earlier selection for that scope.

### JSON body

| Field | Type | Description |
| --- | --- | --- |
| scope_id | string | The [scope](#entrance-sound-scopes) to write (1-32 characters) |
| sound_id | ?snowflake | The clip to assign, or null to clear the scope |

### Response

| Status | Body | Condition |
| --- | --- | --- |
| 204 | empty | The selection was written or cleared |
| 400 | [error response](/http-api/#error-response) | `INVALID_FORMAT` for an unknown scope, or `ENTRANCE_SOUND_NOT_FOUND` when you don't own the clip |
| 403 | [error response](/http-api/#error-response) | `ACCOUNT_LIMITED` when a [limited](/http-api/users/#account-limitation) account assigns a clip |

The rate limit is 20 requests per minute, on the `user:entrance_sound:mutate` bucket.

## Play entrance sound

<RouteHeader method="POST" path="/v1/voice/channels/{channel_id}/entrance-sound" />

Sends an [ENTRANCE_SOUND_PLAY](/gateway/events/#entrance-sound-play) event to everyone else connected to the voice channel, and their apps play the clip from the URL in the event. You need to be connected to the channel.

### JSON body

| Field | Type | Description |
| --- | --- | --- |
| sound_id | snowflake | The clip to play, from your own library |

### Response

| Status | Body | Condition |
| --- | --- | --- |
| 204 | empty | The event was sent |
| 400 | [error response](/http-api/#error-response) | `ENTRANCE_SOUND_INVALID_SCOPE` when you aren't connected to the channel, or `ENTRANCE_SOUND_NOT_FOUND` when you don't own the clip |

The rate limit is 3 requests per 30 seconds, on the `voice:entrance_sound:play::user_id::channel_id` bucket.