# \&audiocodec

Viewer-Side Option! ([`&view`](/advanced-settings/mixer-scene-parameters/view.md), [`&scene`](/advanced-settings/mixer-scene-parameters/scene.md), [`&room`](/advanced-settings/setup-parameters/room.md), [`&solo`](/advanced-settings/mixer-scene-parameters/and-solo.md))

## Options

Example: `&audiocodec=opus`

| Value  | Description                       |
| ------ | --------------------------------- |
| `opus` | default; selects audio codec opus |
| `red`  | selects audio codec [red](#red)   |
| `pcmu` | selects audio codec pcmu          |
| `pcma` | selects audio codec pcma          |
| `isac` | selects audio codec isac          |
| `g722` | selects audio codec g722          |
| `pcm`  | selects audio codec [pcm](#pcm)   |

## Details

`&audiocodec` on the viewer side can let you specify the audio codec; `opus` (default), `pcmu`, `pcma`, `isac`, `g722`, `red` and `pcm`.

#### red

`&audiocodec=red` is pretty much like sending two opus streams, with one as a backup in case of packet loss; support in Chromium 97 and up, but the only way I can so far tell that it is working is to check if the audio bitrate has doubled.

When using [`&proaudio`](/advanced-settings/audio-parameters/and-proaudio.md), [`&stereo`](/advanced-settings/audio-parameters/stereo.md), or higher than [`&audiobitrate=216`](/advanced-settings/audio-parameters/audiobitrate.md) with this, the resulting bitrate may not actually double. I don't quite understand what's going on here, if its still working or not, so to be safe when using [`&proaudio`](/advanced-settings/audio-parameters/and-proaudio.md) or [`&stereo`](/advanced-settings/audio-parameters/stereo.md), along with `&audiocodec=red`, I set the bitrate to 216 by default, which will then result in a sending bitrate of around 440-kbps.

I've tried to enable RED-mode to work with PCM audio, but so far it will only work with OPUS audio.

#### pcm

`&audiocodec=pcm` now will support 48khz and 44.1khz mono playback (48khz default), and if [`&stereo`](/advanced-settings/audio-parameters/stereo.md) is used, it changes to two-channel stereo 32khz.

The existing [`&samplerate=44100`](/advanced-settings/audio-parameters/and-samplerate.md) option can lower the sample rate of this pcm mode (down to 8khz even), and hence the resulting audio bitrate. Since PCM is raw, [`&audiobitrate`](/advanced-settings/audio-parameters/audiobitrate.md) won't work, so expect 550 to 1200-kbps in just audio bitrates per viewer.

There may be clicking when using PCM mode (L16) if you are on a bad connection, as PCM doesn't have much in the way of error correction. You'll need to address this yourself probably with post-processing if any issue.

#### Future options

In the near future you'll be able to send PCM audio via [`&chunked`](/advanced-settings/settings-parameters/and-chunked.md) mode, which will guarantees delivery of all packets sent, however there may be buffering issues if your connection can't keep up with bandwidth requirements.

Currently [`&chunked`](/advanced-settings/settings-parameters/and-chunked.md) mode does work with OPUS-audio though; please provide feedback and requests if you use it. Chunked mode does not support [WHIP/WHEP](/steves-helper-apps/whip-and-whep-tooling.md) or [Meshcast](/advanced-settings/meshcast-parameters/and-meshcast.md).

## Related

{% content-ref url="/pages/-MZdudjg0hJYNiC3VGwt" %}
[\&codec](/advanced-settings/video-parameters/codec.md)
{% endcontent-ref %}

{% content-ref url="/pages/4jEtstQuCuSztogzeaAs" %}
[\&nofec](/advanced-settings/audio-parameters/minptime-3.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.vdo.ninja/advanced-settings/audio-parameters/minptime-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
