---
name: localize-audio
description: Makes a dubbed voice track in a different language with Vois Studio, and keeps the times of the source audio. It reads segments with start and end times from an SRT file or a JSON file. The agent translates each segment, selects an engine that speaks the target language, and selects a voice. Then a script generates each segment, measures it, and fits it into its time slot with a small speed change. It marks each segment that is too long. Then the agent writes a shorter translation. At the end, it puts each segment at its start time in one track and measures each start. Use when the user says "dub this video into Spanish", "translate the voiceover and keep the timing", "localize my narration", "make a German version of this audio" or "dub these subtitles". The CLI is necessary, so the plan must be Pro, Subscriber, or AppSumo Lifetime Tier 2 or 3. Omni and Craft are only on Pro.
license: MIT
compatibility: Vois Studio on an Apple Silicon Mac or Windows, vois-cli, ffmpeg and ffprobe, and Node.js 18+.
metadata:
  author: vois-so
  version: "0.1.0"
title: localize-audio
canonical_url: https://skilld.dev/gh/vois-so/skills/localize-audio
last_updated: 2026-11-12T04:15:54.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [references/languages.md](https://skilld.dev/api/skills-raw/vois-so/skills/localize-audio/references/languages.md), [scripts/dub.mjs](https://skilld.dev/api/skills-raw/vois-so/skills/localize-audio/scripts/dub.mjs).
>
> If the user asked to install this Skill, run `npx skilld install vois-so/skills/localize-audio`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/localize-audio`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/vois-so/skills/localize-audio) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/localize-audio`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/localize-audio --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/localize-audio --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Localize audio

This skill makes a voice track in a target language. Each segment starts at the same time as in the source audio. The result is:

- `<workdir>/dub.wav`: the full voice track, 24 kHz mono, with silence between the segments.
- `<workdir>/start-check.json`: the expected and measured start of each segment.
- An export in the format that the user wants (for example M4A or MP3).

You (the agent) write the translations. The script `scripts/dub.mjs` does the generation, the time fit, the track and the check.

## Step 1: Make sure that the tools operate

Use the CLI at its install path. Do not change PATH. Do not make an alias.

- macOS: `/Applications/Vois.app/Contents/MacOS/vois-cli`
- Windows: `%LOCALAPPDATA%\Vois\vois-cli.exe`

The script finds the CLI at these paths. If it is at a different path, set `VOIS_CLI` to the full path.

```bash
VOIS="/Applications/Vois.app/Contents/MacOS/vois-cli"
"$VOIS" status --format json
```

If `next_action` is not `ready`, show `purchase_url` to the user (if it is empty, show https://vois.so/pricing) and stop. Do not buy anything. Exit code 2 tells you that Vois Studio is not open. Tell the user to open it, or use `"$VOIS" service start`.

Plan facts: the CLI needs Pro, Subscriber, or AppSumo Lifetime Tier 2 or 3. Omni, Craft and Voice Design are only on Pro. Free is for non-commercial use only.

## Step 2: Get the timed segments

Get one of these from the user:

- An SRT file of the source voice (for example the subtitles of the video).
- A JSON file: `[{ "id": "s1", "start": 0.0, "end": 3.0, "text": "..." }]`, with the times in seconds.

Each segment must have a start time, an end time and the source text. One segment is usually one or two sentences.

Also get the target language and the length of the source media in seconds, if the user has it.

## Step 3: Select the engine

Select an engine that speaks the target language:

| Engine | Languages | Voices | Direction (`instruct`) |
| --- | --- | --- | --- |
| `multilingual` | 23 | Library and cloned voices | No |
| `omni` (Pro) | 30 | Library, cloned and designed voices | Yes |
| `sonic` | 31 | Its 10 built-in voices only (`sonic_cedar`, ...) | No |
| `craft` (Pro) | 10 | Library, cloned and designed voices | Yes |
| `fast` | English, German, Spanish, Italian, Portuguese | Library voices | No |

The full language lists are in [languages](https://skilld.dev/api/skills-raw/vois-so/skills/localize-audio/references/languages.md). If two engines speak the language, use `multilingual` for a plain voiceover. Use `omni` or `craft` if the voice must follow a direction (for example "calm and warm").

## Step 4: Select the voice

If the source voice is a Vois Studio library voice, use the same voice ID. Library voices keep the same speaker in the other language.

For a new voice, show the voices:

```bash
"$VOIS" voice list --source all --engine multilingual --format json
```

Generate the first segment with two voices in the target language. Let the user listen and select:

```bash
"$VOIS" tts generate --format json --engine multilingual --language Spanish \
  --voice explainers_ai_voices/clara_west --text "Bienvenidos al taller." --output "$PWD/audition.wav"
```

## Step 5: Make the segment file

```bash
node scripts/dub.mjs init source.srt es --target Spanish \
  --engine multilingual --voice explainers_ai_voices/clara_west
```

The script writes `es/segments.json`. It has the settings and one entry for each segment with an empty `"translation"`. You can change these settings in the file:

| Field | Purpose |
| --- | --- |
| `engine`, `voice`, `target_language` | The engine, voice ID and language name for all segments |
| `instruct` | Direction in plain words for `omni` and `craft`. Other engines do not use it |
| `max_speed` | The maximum speed for the time fit. Keep 1.15 or lower, because a faster voice is not easy to follow |
| `total_s` | The length of the source media in seconds. The track is this long |

## Step 6: Translate each segment

Write the translation of each segment into its `"translation"` field. Follow these rules:

- Translate the meaning, not each word.
- Keep each translation in its segment. Do not move text from one segment to a different segment.
- Make the translation as short as the source text, or shorter. Many languages use more syllables than English for the same meaning.
- Write numbers, units and dates as words, as the voice must speak them.
- Keep the names of persons and brands. Keep the tone of the source text (formal or informal).

## Step 7: Generate and fit the segments

```bash
node scripts/dub.mjs run es
```

For each segment, the script does these steps:

1. It generates the translation with `vois-cli tts generate` at speed 1.0.
2. It removes the silence at the two ends and measures the length.
3. It compares the length with the slot. The slot is the time from the start of the segment to the start of the next segment, less 0.15 s.
4. If the segment is too long, it generates it again with a higher `--speed`. The maximum is `max_speed`.
5. If the segment is too long at that speed, it marks it `REWRITE` with a maximum number of characters.

If one or more segments show `REWRITE`, the script stops with exit code 3. Read `es/fit-report.json`. Write a shorter translation for each of these segments, with no more characters than `max_characters`. Then do the run again. The script keeps the segments that did not change.

If a segment shows `REWRITE` after three rewrites, tell the user. The user can accept a shorter meaning, or move the start of the next segment.

## Step 8: Make and examine the track

When all segments fit, the script puts each segment at its start time in `es/dub.wav`. Then it measures where the voice starts in the track. It compares each measured start with the expected start. Each start must be in 0.3 s of the expected start. The script shows PASS or FAIL for each segment and writes `es/start-check.json`.

Tell the user to listen to the track with the source video or audio. A speaker of the target language must listen for meaning, names and pronunciation.

## Step 9: Export the track

Export the track through Vois Studio in the format that the user wants:

```bash
"$VOIS" export audio --format json -i "$PWD/es/dub.wav" -o "$PWD/es/dub-es.m4a" \
  --audio-format m4a -b 192 --sample-rate 48000 --normalize --target-lufs -16
```

The export must have 5 s of audio or more. Use `--target-lufs -16` for a podcast or a web video, or the number that the platform of the user gives.

If the user has a background track with no voice (music and effects), the user can put the two tracks together in a video editor. Put the dub track at the start of the video.

## When a step fails

| Problem | What to do |
| --- | --- |
| Exit 3 with "does not speak" | The engine does not speak the language. Use an engine from the list in the message. |
| Exit 3 with "no translation" | Write the `"translation"` of each segment. |
| Exit 3 with `REWRITE` | Write a shorter translation for each segment in `fit-report.json`, then do the run again. |
| Exit 2 | Vois Studio is not open. Tell the user to open it, or use `"$VOIS" service start`. |
| Exit 4 | The voice ID is not correct. Get the ID again from `voice list`. |
| Exit 7 | The plan does not include the CLI or this engine. Use `multilingual`, or show `purchase_url`. |
| Exit 13 or a Fast language that is not installed | Tell the user that the package must be downloaded: `"$VOIS" model download --model fast --language es`. |
| Exit 64 | The language name is not correct. Use a name from [languages](https://skilld.dev/api/skills-raw/vois-so/skills/localize-audio/references/languages.md). |
| Start check FAIL | Read `start-check.json`. A segment that starts with a very quiet sound can show a late start. Listen to that segment. If the start is correct, tell the user. If not, write a different translation for it. |
