# Encoding

`encoding` _string_

Pre-recorded  Streaming\:Nova Streaming\:Flux  All available languages

Encoding is required when raw, headerless audio packets are sent to the streaming service. If containerized audio packets are sent to the streaming service, this feature should not be used.

:::callout{intent="info"}
If you are using the Encoding feature, the [Sample Rate](/guides/media-input-settings-sample-rate) feature is also required.
:::

## Enable Feature

To enable Encoding, when you call Deepgram’s API, add an `encoding` parameter in the query string and set it to the audio coding algorithm of your submitted audio:

`encoding=OPTION`

**`cURL`**

```bash cURL
curl \
  --request POST \
  --header 'Authorization: Token YOUR_DEEPGRAM_API_KEY' \
  --header 'Content-Type: audio/mp3' \
  --data-binary @youraudio.mp3 \
  --url 'https://api.deepgram.com/v1/listen?sample_rate=8000&encoding=linear16'
```

Deepgram supports the following audio coding algorithms:

:::callout{intent="info"}
Flux supports `linear16`, `linear32`, `mulaw`, `alaw`, `opus`, and `ogg-opus` for non-containerized/raw audio. Flux also supports containerized formats: `linear16` in WAV containers, `opus` in Ogg containers, and `opus` in WebM containers (omit the `encoding` parameter for containerized audio).
:::

- `linear16`: 16-bit, little endian, signed PCM WAV data
- `linear32`: 32-bit, little endian, floating-point PCM WAV data
- `flac`: Free Lossless Audio Codec (FLAC) encoded data
- `alaw`: A-law encoded WAV data
- `mulaw`: Mu-law encoded WAV data
- `amr-nb`: Adaptive Multi-Rate (AMR) narrowband codec
- `amr-wb`: Adaptive Multi-Rate (AMR) wideband codec
- `opus`: The Opus audio codec
- `ogg-opus`: The Opus audio codec encapsulated in the Ogg container format
- `speex`: An open-source, speech-specific audio codec
- `g729`: G729 low-bandwidth (required for both raw and containerized audio)

***

## Related pages

- [Amazon SageMaker](./amazon-sagemaker-index.md)
- [Aura](./aura-index.md)
- [Changelog](../changelog.md)
- [Custom Vocabulary](./custom-vocabulary-index.md)
- [Deepgram's Docs](../index.md)
- [Deployment](./deployment-index.md)
- [Docker/Podman](./docker-podman-index.md)
- [Features](./features-index.md)
- [Flux TTS](./flux-tts-index.md)
- [Formatting](./formatting-index.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
