> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/cas-telegram/voice-messages.md).

# Voice messages

Voice messages in CAS Telegram — recorded wires stored on your database and played back like a telegram. Turn capture on or off, set length, quality and retention.

Players hold the microphone button, speak, and send. The person on the other end presses play and hears it.

This has nothing to do with your proximity voice resource. A voice wire is a recording kept on your database and played back later, like a telegram, not a radio.

## Turning it on or off

```lua
Config.VoiceCapture = true
```

Set it to `false` if you do not want recorded audio on your server. Voice then becomes a silent length marker instead, and nothing is stored.

## Settings

```lua
Config.MaxVoiceSeconds = 30
Config.VoiceBitrate = 16000
Config.VoiceKeepDays = 14
```

| Setting           | What it does                                                       |
| ----------------- | ------------------------------------------------------------------ |
| `MaxVoiceSeconds` | Longest recording. Sending happens automatically at the limit.     |
| `VoiceBitrate`    | Quality. `16000` is clear speech. `32000` is the sensible ceiling. |
| `VoiceKeepDays`   | Recordings older than this are removed. `0` keeps them forever.    |

## Storage

Recordings live in your database. At the default quality a thirty second message is about 80 KB.

A server with heavy use should leave `VoiceKeepDays` on. Raising `VoiceBitrate` grows every recording and the traffic with it.

## Microphone permission

Players must allow microphone access for RedM in their own Windows privacy settings. This is on their machine and nothing you set on the server changes it.

If a player presses record and it does not work, the device tells them which of three things happened:

| Message                        | What it means                                 |
| ------------------------------ | --------------------------------------------- |
| The microphone was refused     | Permission is off in Windows privacy settings |
| No microphone was found        | No device is plugged in or selected           |
| This build cannot record audio | Their game build cannot record at all         |

The last one is rare. If your whole playerbase sees it, set `Config.VoiceCapture = false`.

## Checking it works

Press the microphone button and speak. The bars move with your voice. If the bars move, the microphone is working and the recording will send.

## Flood protection

```lua
Config.RateLimits.voice = { count = 3, seconds = 30 }
```

Three recordings in any thirty seconds. Every one of these is a file, so this is deliberately tighter than the limit on typed wires.
