> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Noise suppression

> Remove background noise from raw audio before transcription on the Telnyx Speech-to-Text WebSocket endpoint with the noise_suppression, nss_model, and nss_quality parameters.

> [!NOTE]
>
> **Raw audio formats only** (`linear16`, `linear32`). Not supported for the `Telnyx`, `Azure`, `Cohere`, and `Parakeet` engines.

Set `noise_suppression=true` to denoise the audio stream before the transcription engine receives it. Noise suppression adds a short processing delay.

```
wss://api.telnyx.com/v2/speech-to-text/transcription?transcription_engine=Deepgram&input_format=linear16&sample_rate=8000&noise_suppression=true&nss_model=quail
```

The service uses the same models as the [Noise Suppression WebSocket API](/docs/voice/noise-suppression/websocket-streaming), capped at the 16 kHz model.

## Parameters

| Parameter | Values | Default | Description |
| - | - | - | - |
| `noise_suppression` | `true`, `false` | `false` | Denoise the audio before transcription. |
| `nss_engine` | `aicoustics` | `aicoustics` | Noise suppression engine. |
| `nss_model` | `rook`, `quail` | `rook` | Model family. We recommend `rook` for audio that people listen to and `quail` for audio that goes to speech-to-text. |
| `nss_quality` | A number from `0` to `1`, or `low_latency`, `balanced`, `high_quality` | `balanced` | Suppression strength. |

Only the lowercase value `true` enables noise suppression. The `nss_*` parameters are validated only when `noise_suppression=true`.

## Sample rates

Set `sample_rate` to the native sample rate of your audio. Noise suppression supports a `sample_rate` from `8000` to `192000` Hz. Outside this range, the audio is transcribed without noise suppression and no error is sent. Audio sent before the noise suppression service rejects the session may not be transcribed.

The service selects the model variant from `sample_rate`:

| `sample_rate` (Hz) | `rook` | `quail` |
| - | - | - |
| 8000 | 8 kHz model | 8 kHz model |
| Above 8000 | 16 kHz model | 16 kHz model |

Above 8000 Hz, both models use the 16 kHz model, so the output bandwidth is limited to 8 kHz.

Send telephony and PSTN (narrowband) audio at `8000`. Do not upsample 8 kHz audio to a higher rate.

## Errors

An invalid combination closes the connection with an [error](/docs/voice/stt/websocket-streaming/errors) before streaming starts. If the noise suppression service rejects or fails the session after the connection opens, for example for an unsupported `sample_rate`, the audio is transcribed without noise suppression and no error is sent. Audio sent before the noise suppression service rejects the session may not be transcribed.

* `40008` Invalid NSS Format: `input_format` is not `linear16` or `linear32`.
* `40009` Unsupported NSS Engine: `transcription_engine` is `Telnyx`, `Azure`, `Cohere`, or `Parakeet`.
* `40010` Invalid NSS Engine or Invalid NSS Model: `nss_engine` is not `aicoustics`, or `nss_model` is not `rook` or `quail`.
* `40011` Invalid NSS Quality: `nss_quality` is not a number from `0` to `1` or a preset name.
