# Audio & Subtitles

> Add background audio and subtitles to your template pages for video rendering

- **URL**: https://orshot.com/docs/orshot-studio/audio-subtitles

---

Each page in your template can have its own background audio track and subtitles. These are configured directly in the Studio editor and are automatically included when you render the template as a video.

## Adding Audio

Click the **speaker icon** in the timeline bar below the canvas to open the audio panel.

### Upload

Drag and drop or click to upload an audio file. Supported formats: `.mp3`, `.wav`, `.m4a`, `.ogg`, `.aac` (max 10 MB).

Once uploaded, the audio waveform appears in the timeline and the file is attached to the current page.

### Audio Controls

| Control    | Description                                              |
| ---------- | -------------------------------------------------------- |
| **Volume** | Mix level from 0% to 100%                               |
| **Trim**   | Set start and end points to use a specific portion       |
| **Offset** | Delay when the audio starts playing within the page      |
| **Fade**   | Fade in and fade out duration in seconds                 |
| **Loop**   | Repeat the audio to fill the full page duration          |
| **Mute**   | Temporarily disable the audio without removing it        |

### Timeline

When audio is attached, a draggable bar appears in the expanded timeline. You can:

- **Drag** to reposition the audio (changes the offset)
- **Resize edges** to adjust trim points
- **Hold and drag** to slip-edit (shift the audio content within the trim window)

### How Audio Renders

Page audio is automatically mixed into the video output alongside any audio from video elements on the same page. No API changes are needed.

- `videoOptions.muted: true` mutes everything, including page audio
- When `muted` is not set or `false`, page audio is included automatically
- Volume, trim, offset, fade, and loop settings are all applied during rendering

## Adding Subtitles

Click the **closed captioning icon** in the timeline bar to open the subtitle panel.

### Upload SRT

Click **Upload SRT** to attach a subtitle file. Supported formats: `.srt`, `.vtt`.

The file is parsed and the cue count is shown in the panel.

### Auto-Generate from Audio

If the page has audio attached, click **Generate from audio** to auto-transcribe the audio using OpenAI Whisper. This creates subtitles from the page's audio track.

### Subtitle Controls

| Control        | Description                                     |
| -------------- | ----------------------------------------------- |
| **Enable**     | Toggle subtitles on or off for this page        |
| **Font**       | Font family and weight                          |
| **Size**       | Subtitle text size                              |
| **Color**      | Text color                                      |
| **Background** | Background color behind the subtitle text       |
| **Position**   | Display at the top or bottom of the video       |
| **Offset**     | Distance from the top or bottom edge            |
| **Padding**    | Horizontal and vertical padding around the text |
| **Radius**     | Corner radius of the subtitle background box    |
| **Shadow**     | Text shadow offset, blur, and color             |

### How Subtitles Render

Page-level subtitles are used automatically when rendering videos. If you also pass a `videoOptions.subtitleSource` in the API request, it takes priority over the page-level subtitle.

Subtitle styles configured in the editor are applied during rendering. API-level `videoOptions.subtitle*` properties (like `subtitleColor` or `subtitleFontSize`) override the page-level styles when provided.

## Multi-Page Templates

Each page has its own independent audio and subtitle configuration. When rendering a multi-page video slideshow with `videoOptions.combinePages: true`, each page's audio and subtitles are included in its segment of the final video.

## API Reference

Page audio and subtitles require no API changes — they work automatically when you render a video. For API-level overrides and additional options, see:

- [Video Options](https://orshot.com/docs/video-generation/video-options) — global audio muting, subtitle styling overrides
- [Adding Subtitles](https://orshot.com/docs/video-generation/adding-subtitles) — API-level subtitle sources and styling
- [Template Anatomy](https://orshot.com/docs/definitions/template-anatomy) — page `audio` and `subtitle` object schemas