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

# Audio Examples

> Request bodies for audio element features.

Each example is a complete `POST /v1/renders` body. Only fields that differ from their defaults are shown. See the [element field reference](/renders/elements) for every default.

<Warning>
  For **text** and **image** elements, `duration` is required — the API returns `422` if it is missing. **`video` and `audio` elements have no `duration` field** — use `out_point` to control clip length. `volume` must be greater than `0` — the renderer silently drops audio streams with `volume ≤ 0`.
</Warning>

## Background audio

A separate audio track over a video. `volume: 0` on the video mutes its embedded audio so only the audio track is heard.

```json theme={null}
{
  "width": 1920,
  "height": 1080,
  "duration": 6,
  "elements": [
    {
      "type": "video",
      "source_url": "https://cdn.example.com/clip.mp4",
      "volume": 0
    },
    {
      "type": "audio",
      "source_url": "https://cdn.example.com/music.mp3"
    }
  ]
}
```

## Trim audio source

Play only seconds 30–36 of the source file.

```json theme={null}
{
  "width": 1920,
  "height": 1080,
  "duration": 6,
  "elements": [
    {
      "type": "video",
      "source_url": "https://cdn.example.com/clip.mp4",
      "volume": 0
    },
    {
      "type": "audio",
      "source_url": "https://cdn.example.com/music.mp3",
      "in_point": 30,
      "out_point": 36
    }
  ]
}
```

## Repeat audio

Repeat a 6-second clip to cover a 12-second render. Add one element per repeat with a different `time` and the same `in_point`/`out_point`.

```json theme={null}
{
  "width": 1920,
  "height": 1080,
  "duration": 12,
  "elements": [
    {
      "type": "video",
      "source_url": "https://cdn.example.com/clip.mp4",
      "volume": 0
    },
    {
      "type": "audio",
      "id": "music1",
      "source_url": "https://cdn.example.com/music.mp3",
      "time": 0,
      "in_point": 0,
      "out_point": 6
    },
    {
      "type": "audio",
      "id": "music2",
      "source_url": "https://cdn.example.com/music.mp3",
      "time": 6,
      "in_point": 0,
      "out_point": 6
    }
  ]
}
```

## Fade in and out

Fade audio in over 0.5 seconds and out over 1 second.

```json theme={null}
{
  "width": 1920,
  "height": 1080,
  "duration": 6,
  "elements": [
    {
      "type": "video",
      "source_url": "https://cdn.example.com/clip.mp4",
      "volume": 0
    },
    {
      "type": "audio",
      "source_url": "https://cdn.example.com/music.mp3",
      "fade_in_duration": 0.5,
      "fade_out_duration": 1
    }
  ]
}
```

## Lower volume

Mix audio at 50% volume alongside the video's embedded audio.

```json theme={null}
{
  "width": 1920,
  "height": 1080,
  "duration": 6,
  "elements": [
    {
      "type": "video",
      "source_url": "https://cdn.example.com/clip.mp4"
    },
    {
      "type": "audio",
      "source_url": "https://cdn.example.com/music.mp3",
      "volume": 50
    }
  ]
}
```
