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

# Loudness

> Normalising audio to a target loudness, and reading back what was achieved

## What loudness normalisation is

Two tracks peaking at the same level can sound very different in volume. **Integrated loudness** measures how loud a track sounds over its whole length, the way a listener hears it, in **LUFS** (Loudness Units relative to Full Scale, defined by the EBU R128 / ITU-R BS.1770 standards). Normalising a track adjusts it so its integrated loudness lands on a target you choose, so that everything you deliver plays back at a consistent level.

You ask for it with a `loudness` block. Seven endpoints accept one:

| Endpoint | What gets normalised | Normalisation is |
| - | - | - |
| [`create.new_song`](/guides/create/new_song) | every variation | opt-in |
| [`create.new_instrumental`](/guides/create/new_instrumental) | every variation | opt-in |
| [`create.remix_song`](/guides/create/remix_song) | every variation | opt-in |
| [`create.remix_instrumental`](/guides/create/remix_instrumental) | every variation | opt-in |
| [`adapt.auto_cut_down`](/guides/adapt/auto_cut_down) | the cut | opt-in |
| [`adapt.normalise_loudness`](/guides/adapt/normalise_loudness) | a track you supply | always on |
| [`adapt.auto_duck`](/guides/adapt/auto_duck) | the mix | always on |

`create.new_sample`, `create.new_fx` and `adapt.separate_stems` don't take a `loudness` block. To normalise their outputs, pass them to `adapt.normalise_loudness`.

***

## Asking for it

The block takes the target either as a **number** or as a named **preset**, never both:

```json theme={null}
{ "target_lufs": -18, "allow_compression": true }
```

```json theme={null}
{ "preset": "podcast" }
```

| Field | Default | Meaning |
| - | - | - |
| `target_lufs` | `-14` | The integrated loudness to land on, between `-30` and `-6`. |
| `preset` | none | A named destination standing for a fixed target; see [Presets](#presets). Use it instead of `target_lufs`. |
| `allow_compression` | `true` | What to do when the target can't be reached by a change of level alone. See [below](#allow_compression). Works with either form. |

`{}` asks for the defaults: -14 LUFS, with compression allowed. A block with both `preset` and `target_lufs` is refused with a `422`.

### Opt-in or always on

* **Opt-in** on the five endpoints that produce or cut music. Leave `loudness` out and the outputs come back exactly as produced, with no `loudness` fields in the response at all. Include the block, even `{}`, to normalise them.
* **Always on** on `adapt.normalise_loudness`, which exists to normalise, and `adapt.auto_duck`, which delivers a finished mix at a known loudness. There the block is optional: leaving it out means the defaults.

Normalisation never costs extra. The opt-in endpoints charge their usual price; the two always-on endpoints charge 1 credit per request, normalisation included.

***

## Presets

A preset names where the audio is going. Each stands for a fixed target, and **a preset's value never changes**, so a request that names one means the same thing next year as it does today.

| Preset | Target | What it's for |
| - | - | - |
| `streaming` | -14 LUFS | Music for streaming services and online video, which most of them play back at about this level. The same as the default. |
| `podcast` | -16 LUFS | Podcasts and other spoken-word audio, the level podcast platforms recommend. |
| `broadcast` | -23 LUFS | Television and radio broadcast, the EBU R128 standard. |

For a destination that isn't a preset, send its number as `target_lufs`. The [loudness normalisation guide](/guides/adapt/normalise_loudness#choosing-a-target-by-destination) has a table of common destinations.

***

## The peak ceiling

Normalised audio always keeps its **true peak at or below -1 dBTP**. That ceiling is fixed, and isn't a field: it leaves the headroom that lossy encoding and playback need to stay free of clipping, and a higher ceiling would only trade that headroom away. Every preset fits under it.

***

## `allow_compression`

Changing the level of a track moves its loudness and its peaks by the same amount. Most audio can reach its target that way without its peaks going over the ceiling, and then the level is the only thing that changes, whatever `allow_compression` says.

Very dynamic audio, with loud peaks relative to its average level, can't: turning it up far enough to reach the target would push its peaks over the ceiling. `allow_compression` decides what happens then:

| Value | Result |
| - | - |
| `true` (default) | The dynamics are gently compressed so the track lands close to the target, typically within about 1.5 LU. |
| `false` | Only the level changes, stopping at the ceiling. The dynamics are untouched, but the track ends up quieter than the target. |

Choose `false` when preserving the dynamics matters more to you than hitting the number. The [loudness normalisation guide](/guides/adapt/normalise_loudness#three-possible-outcomes) shows a worked example of each outcome.

***

## What's measured

When normalisation was applied, the response tells you two things.

The operation **echoes what you asked for**, with any omitted fields filled in:

```json theme={null}
"loudness": { "target_lufs": -16.0, "allow_compression": true, "preset": "podcast" }
```

`target_lufs` is always present, whichever way you asked. `preset` is present only when you named one; it is absent (not `null`) when you sent a number or `{}`.

Each `ready` output carries a `loudness` block **measured on the audio you download**:

```json theme={null}
"loudness": { "lufs": -16.0, "true_peak_dbtp": -2.1, "compressed": false }
```

| Field | Meaning |
| - | - |
| `lufs` | Integrated loudness measured on the delivered audio. |
| `true_peak_dbtp` | True peak measured on the delivered audio. |
| `compressed` | Whether reaching the target meant altering the dynamics. `false` means only the level changed. |

These are **measured, not assumed**: when a track can't reach the target (see `allow_compression` above), `lufs` reports where it actually landed, so you can decide for yourself whether the difference matters. On an endpoint with variations, each variation is normalised and measured separately.

Output `loudness` is only present once the operation is `ready`. On an opt-in endpoint where you didn't ask for normalisation, there is no `loudness` field at all, neither the echo nor on the outputs: absent, not `null`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.