voice-pack

Community@ncyg191125/voice-pack
Community skill — not reviewed. It was shared by DeltaSalem and has not been checked by Neta. Read SKILL.md below before letting an agent use it.
Installation
npx -y @neta-art/neta-search-cli@latest skills add @ncyg191125/voice-pack
Summary

Turn a voice recording into a reusable voice pack, then dub lines, scenes and narration in that character's voice.

  • Make a voice from a clean recording of 5 to 20 seconds, blend several voices into one, or borrow a close voice from a library.
  • Dub a single line, a scene where several characters take turns, or a whole narrated chapter, and join the pieces into one audio file.
  • Mark pauses, whispers, laughs and sighs in your script, so the delivery fits the moment instead of sounding flat.
  • Lines can be in a different language from the recording; the result may carry a little of the recording's accent.
  • Works best with a clear, noise-free recording and a character with a distinct personality and way of speaking.
SKILL.md
# The base part of a voice pack

A voice pack has two parts: the **role part** (a voice's reference set and dubbing guidance) and the **base part** (this directory). The base part holds what does not depend on a specific character: the general flows for making voices and synthesizing speech, the protocol core (the format specification and the programs that read, write and check voice packs), the vocabularies, the environment adapter layer, and the official small tools. For an overview of the directory see `README.md`.

Flows are written by **required capability** and do not name models. Models come in only through **adapters**: an adapter maps required capabilities to concrete models in one runtime environment, and all adapters together are the **environment adapter layer** (`adapters/`). How to use a model itself (how to write cues, how to supply references, the model's own limits) is written in its **model notes**: `models/`, one file per model, the file name is the model name, not tied to a platform.

## Dubbing by scene

To dub a passage with a voice pack, first find the scene sub-skill (under `scenes/`, one file per scene) and follow that one: what "fit" means in this scene, how to change the script, how to write cues, which reference segment to use, and what to say when handing the result back. For the commands see section 6.

| Situation | Read |
|---|---|
| A character says one line or a few lines to someone in a conversation (one reply in role-play, one line in a work); also read this one when no scene is named | `scenes/one-line.md` |
| A line dubbed for a video, with the duration matched to the picture | `scenes/one-line.md`, plus the step "A line timed to the picture" |
| Several characters take turns in one continuous scene, and the result is one whole passage (including one actor playing several characters) | `scenes/a-scene.md` |
| Words addressed to the listener, not to someone in the story: narration, a chapter of an audiobook, reading a long text aloud, an announcement, an explanation, a short-video voice-over | `scenes/narration.md` |
| 17+ edge content (flirting, whispering close to the ear, kissing, lulling to sleep, ASMR), for adult characters only; it stops at the threshold | `scenes/17plus_sfw.md`, and also the one of the three above that matches whether it is one line, a scene or narration |
| The audition line (the one line that plays on the pack's preview card) | Not dubbed separately; it is fixed when the pack is made: one line handed in and dubbed when making the pack (`--card-line`), the same for a library voice and for a voice made from a recording; if no such line is handed in, the card plays the recording of the default segment of the main language, which is only a fallback. What the voice needs from this line: `references/character-voice.md`「Audition line」; what the card plays and how it is dubbed: `references/make-pack.md`「Default segment and audition line」 |

## 0. Hard rules

1. **Cost belongs to the user.** Generation, large language models and transcription are all charged to the user's own account and authorized by the user; they use the user's own quota, and the token is managed by the user's own login state. How to authorize depends on the notes of the adapter that is connected.
2. **The workflow names required capabilities, not models** (where a model name may appear: `README.md`「Rules」). Which model serves a capability in the current runtime environment, and what extra limits the platform adds, is in the mapping table of the connected adapter (models change, and what you remember goes stale); how to use that model itself is in its model notes (`models/<model name>.md`); the model's live parameters are looked up the way the runtime environment does it. When a flow or reference document needs one item from the model notes, write the path and section name of that note and do not copy the content over.

## 1. Required capabilities

- **Capability vocabulary** is in `vocab/capabilities.json`, with a version number. Where a general name exists it uses the Hugging Face task name (`text-to-speech`, `automatic-speech-recognition`, `audio-text-to-text`, `text-generation`, etc.); where none exists it uses the name the industry has converged on (`voice-cloning`, `voice-design`, `text-to-dialogue`, `audio-source-separation`, etc.); parameter names are `ref_audio` and `ref_text`. The capabilities written in flows and in packs are taken only from this vocabulary.
- **A capability missing from the runtime environment** means that only the feature that uses it reports an error, and says which capability is missing; other features work as usual. How capabilities are obtained and how the error is written: `protocol/README.md`「Runtime environment」 (read it when writing an adapter).
- **Adapter**, one per kind of runtime environment. The only official one is `process` (it forwards capability calls to your own program; entry point `adapters/process/README.md`); other adapters live in their own directories and are connected by path. The conventions are written only in `adapters/README.md`.
- Processing that needs a model (separation, watermarking, speaker similarity, transcription) is requested from the runtime environment as a required capability; if the runtime environment does not have it, report it as unavailable.

## 2. Three ways to make a voice

| Flow | Required capability | Input | Output |
|---|---|---|---|
| Clone | `voice-cloning` (parameters `ref_audio`, `ref_text`); the verbatim transcript can be transcribed with `automatic-speech-recognition` | One clean reference (for a pack, 5 to 20 seconds is advised and 10 to 20 seconds is best, without accompaniment; a shorter one is still made, the model's requirements are in the model notes and the platform's requirements in the adapter notes, and if the platform refuses, report its own words) and its verbatim transcript | A voice |
| Library voice | `voice-cloning`; the reference passage is dubbed with the library voice | A voice from the voice library, chosen in the order of `references/character-voice.md`「Order of choosing a voice」 | An acted passage dubbed with it, used as the reference; go on by cloning |
| Blend | `voice-cloning`, passing several references | 2 or more references (`ref_audio` given as an array) | A blended voice |

**Clone**: to make a voice pack from a recording, follow `references/make-pack.md`「Recordings supplied by the user」: `make-pack --recording` removes accompaniment (when the environment has `audio-source-separation`), cuts segments, transcribes, and normalizes loudness to −20 LUFS, all done by the command; if only a few seconds of the recording are wanted, write the material with `trim`. Hand in the audition line with `--card-line` (what the voice needs from it: `references/character-voice.md`「Audition line」): do not synthesize a separate audition line, and do not put a segment of the recording on the card. A voice from a voice library does not take this path; it goes through the acted passage (`references/make-pack.md`「Making a pack from a library voice」).

**Library voice**:
1. Find the voice following `references/character-voice.md`「Order of choosing a voice」: this character's own voice in the library, or, if the library has none, one of another character whose voice is close, found by guessing names (what the user is told in the second case: item 4 there). The acted passage of step 2 and the audition line of step 3 are in the language this character is to speak (the same one), which is given by the caller (`references/character-voice.md`「Language and accent」).
2. Dub an acted passage with the library voice and use it as the reference: first make a temporary pack from the library voice (raw material only, not handed out); take the text to dub for this passage, handed in by the caller (what the voice needs from it: `references/character-voice.md`「Default segment: a passage the character says naturally, with acting」), `dub` it with the temporary pack, with the expressiveness chosen for this character (`--expressiveness <this character's value>`, which applies only to dubbing this passage; when the real pack is made it is written into the default setup; `models/scene3.md`「How to choose the value」), dub it once and use what comes out; if `dub` reports a failure or switched models, handle it per `references/make-pack.md`「Making a pack from a library voice」step 2; `speech_maybe_unfinished` only reports which passage may have been cut, and does not redub automatically; a passage dubbed longer than 20 seconds is cut at sentence ends by the pack making and used as is, not redubbed. Then make the real pack from the dubbed passage. In the real pack the only reference is this passage; it is the default segment, all later dubbing and the audition line come from it, and no emotional lines are cloned separately. For material and commands see `references/make-pack.md`「Making a pack from a library voice」.
3. Hand in the audition line with `--card-line` when making the real pack (what the voice needs from it: `references/character-voice.md`「Audition line」): after the pack is made it is dubbed with this pack, and the pack's preview card plays it.

When an agent finishes a round without asking a person, which voice is handed over and what the report says: `references/character-voice.md`「Finishing a round without asking, and switching to another」; if the user listens and is not satisfied, switch to another following that section.

**Blend**: how to blend (equal weights or weighted) is decided by the environment, and neither the pack nor the library passes weights (`voice-cloning` in `vocab/capability-signatures.md`); if an adapter has its own option for tuning weights, it is written in its notes. The maximum number of segments that can be blended is stated by the adapter.

**How to choose a capability**: with more than one reference, use `voice-cloning` to blend; otherwise follow the caller's request, and with no request use `voice-cloning` if there is a reference and `text-to-speech` if there is none. `voice-design` stays in the vocabulary (adapters may declare it), but no flow in this base part calls it.

**Starting from an existing character**: first see what materials you have (the character's text: novel, script, setup; recordings: original dubbing, sample voice of the same person), then choose a route following `references/character-voice.md`「Order of choosing a voice」: if the user gave a recording, or the library has a recording of this character themselves, go by cloning and take the verbatim transcript from the recording; if neither, take the voice of another character that is close, following items 3 and 4 there, and go through the acted passage as in "Library voice" above. The acting style and the lines are analyzed from the text materials by `text-generation`; with a recording, make the pack following `references/make-pack.md`「Recordings supplied by the user」, make the pack once and be done, and hand in the audition line with `--card-line` as usual. If the user says what language the recording is in (or the source shows it, for example the original Japanese dub) and it is not the language this character is to speak (the audition line, the lines to dub), do not ask; dub following `references/character-voice.md`「Language and accent」; do not guess when it cannot be seen, and the pack-making and dubbing reports will say so (`references/character-voice.md`「Language and accent」). In the analysis every item carries its source, and what the materials do not contain and was inferred from the character type is marked "inference"; when writing into the pack, each item of the acting style gets only its content, without source or mark (when dubbing, write cues following the acting style), while timbre and lines keep their sources as before. How the default segment is decided: `references/character-voice.md`「Default segment: a passage the character says naturally, with acting」; what the voice needs from the audition line: "Audition line" in the same file.

## 3. Synthesizing a passage

1. Apply the pronunciation lexicon: replace words that are easy to misread with the intended reading.
2. Split: one passage (a non-empty line of the script, same voice) is spoken in one request; if the whole chapter fits, do not split it, and if it does not fit, split only at the boundaries of scenes, paragraphs, speaker changes and sentences. One request defaults to about 1000 characters to be read aloud (about 170 words in English), and where an adapter declares `limits.maxChars`, the text sent does not exceed it either. The places that are always split (chapters, a change of voice, a long pause that does not fit in a request, ...) and the detailed rules are in `references/dub.md`「One request per passage」「How long text is split」.
3. Parse the script markup (section 4); short pauses stay in the text of the request. When dubbing with a voice pack, one passage uses one reference segment (how to pick it: `references/dub.md`「How a line becomes synthesis」step 3), and the pack's pronunciation lexicon and dubbing guidance are read, see section 6 "Dubbing and changing a voice with a pack".
4. Generate the requests one by one; several requests can run concurrently. With `dub` the progress is recorded in `dub.json` in the output directory: if it was interrupted or some lines failed, run the same command again with the same `--out`, and the lines that were completed are reused by content, with no repeated charge. A line that the service finished but whose result was not retrieved (`details.unretrieved`), and one where a step after synthesis went wrong (`afterSynthesisFailed`), will be redubbed when run again and charged again (`references/dub.md`「Failure and redo」, details in `references/dub-details.md`「Failure and redo details」).
5. Stitch locally (`mix`): the pause between two requests (the one written in the script, and the default pause `dub` records at the cut) is inserted as silence, the silence on both sides of a speaker change is shortened, and the speed change that `dub` did not apply is applied here (rules in `references/dub.md`「Stitching」, details in `references/dub-details.md`「Stitching details」).
6. Add a watermark when needed (`audio-watermarking`).
7. State the cost: what the user agrees to before money is spent is the upper limit computed from the adapter's cost notice (`billing`) (before the first spend, the command writes to standard error the maximum number of calls for each capability). The report does not contain how much was actually spent: `cost` is not in the capability signatures (`vocab/capability-signatures.md`「General conventions」); the actual spend is in the runtime environment's own bill or task records. Where the adapter gave unit prices (`prices`, `adapters/README.md`), the cost notice and the dry run also contain an amount estimated from the unit prices; where it did not, they say it cannot be estimated.

## 4. Script markup and the design vocabulary

These vocabularies are JSON, kept in `vocab/`; the programs that use them read the same copy. The list of script markup and how to write it are in `references/markup.md`: there are only three kinds, `# title`, `[pause 0.6s]` and `[voice:<voice>]`. Any other square bracket is a cue (`[hushed voice]`, `[sad and surprised]`, `[laughs]`), handed to the model as is and by position; write it where the way of speaking changes, there can be several in one line, each of two or three words and not written as a sentence; write the concrete manner, not a general label such as accent or tone (`models/scene3.md`「What to write」); stage directions such as `(耳语)` and `*笑*` (Chinese stage directions: "whispering", "laughs") are replaced by `dub` with English cues of the same meaning (`[whispering]`, `[laughs]`). Tags in angle brackets (`<whisper>…</whisper>`, `<french>…</french>`, phoneme tags) are text and are also handed to the model as is. Of the control notations the dubbing model recognizes, use all that the vendor documentation lists, in the right places: see `models/scene3.md`「Cues」.

**Changing the script by scene**: how to change the script and how to write cues are written separately in the scene sub-skills, by the scene the dubbing is in (one line in a dialogue, a scene with several people, narration and long text); which one to read for which situation is in the routing table in "Dubbing by scene" at the start. The pack does not mark "where this voice is suitable": wherever the same voice is dubbed, the aim is to make it fit that scene. First write the lines following `models/scene3.md`「Set the state first, then write the cue.」, then add a few things: a pause (write `,[pause 0.6s]` after a comma) and a sigh (`[sighs]`); the way to write them and the basis are in `models/scene3.md`「Add a few more things when dubbing.」[^b1].

**Design vocabulary** (`vocab/design.json`): the categories and optional values that callers read, the voice / rhythm / emotion tags, and the 8 preset characters. The voice tags "机械感" (robotic), "金属感" (metallic) and "低吼" (growling) describe how a voice sounds, not the character. 

**Tag vocabulary** (`vocab/cues.json`): the names of emotion (`emotion`), style (`style`) and actions (`actions`: pause, slow, fast). Which of them a tone note in brackets in the script (for example `(耳语)`, `*笑*`) is recognized as is also looked up in this file.

## 5. Command line

Run `node cli.mjs help` in this directory to list the commands currently available, and `node cli.mjs <command> --help` for usage. With only the protocol core, use `node protocol/cli.mjs`. By default the command line gives a command a runtime environment that has only network reading and no required capability at all; for a command that uses a model, connect an adapter with `--adapter` (see section 8 and `adapters/README.md`). How commands are written, the exit codes and how errors are reported: `protocol/README.md`「Command line」 (read it when a command fails or you need the exit codes). The commands that install into the environment, dub and change a voice are written in section 6 "Dubbing and changing a voice with a pack"; making a pack (`node cli.mjs make-pack`) is written in section 7 "Making a pack". To compare Chinese characters by pronunciation (for example comparing a transcription with the script, where a transcription often hears homophones wrongly) use `node cli.mjs reading <text file|-> [--json]`: every character in the text that is in the reading table gets a mark, and the marks are the same when the readings are the same (tones ignored; for a polyphonic character only the first reading counts); characters not in the table are not in the result, so compare those by the character itself; `--json` returns `{ "readings": { "<character>": "<mark>" } }`. The marks are only for comparing with each other and may change between versions, so do not store them to compare across versions; do not read `lib/mandarin-readings.json`.

## 6. Dubbing and changing a voice with a pack

When you get a voice pack (the directory of a role part, containing `manifest.json`, `SKILL.md` and `reference/`), first `install` it into the environment, then dub a script with its voice (`dub`), or change a piece of audio into its voice (`convert`). None of the three commands names a model; they only need the runtime environment to have the matching required capabilities. First add `--dry-run` to see the plan: it only plans, does not synthesize and costs nothing.

Old packs of protocol 1.x and 2.x can be installed, but this version does not dub or change voice with them: `dub` and `convert` stop as soon as the pack is opened and report `pack_protocol_old` (`details.protocol` is the protocol version the pack declares), and no capability is called. Dub an old pack with the base part of its own major version: a full pack uses the one it carries, and a pack with only the role part uses the one of that major version (`references/dub.md`「Dub a passage」). `make-pack --previous` does not accept an old pack either: to bring this voice to this version, make a new pack again from the material.

**No accent by default.** The language of the lines is the one the caller gives[^b2], not the language of the audio[^b3]. When the reference segment used is not in the language of this line (the pack has only Japanese references and the line is English), do not ask the user and do not add another reference: write the line in the target language, add `--allow-cross-language`, and at the start of each line write a name pair `[name in the reference language|name in the line's language]` (`[Harry Potter|哈利·波特]`); the names on both sides and the language hint are written by `dub`: the pair is the pack's `name` plus the name in the line's language as the one writing the lines gives it (the `- 名字:` item of the dubbing guidance when it has one; otherwise a transliteration or the original work's official translated name, which is not making a name up), and a line without a name pair (the pack has no `name` and the writer cannot give the other side) makes `dub` stop before any money is spent and report `dub_cross_language_unnamed`. When the user wants an accent, write that accent, do not write a name pair, and add `--no-language-marks`. Square brackets say what to hear, not what to avoid, so do not write negations such as `no`, `not`, `without`. The dubbed result often carries the accent of the reference's language[^b4], and the `[native English pronunciation]` and `<english>` that were listened to did not remove it either (`models/scene3.md`「Cross-language and accent」)[^b5]. Without this option, `dub` stops before any money is spent and reports `dub_cross_language`: which lines, which pack, the reference segment's language → the line's language (`ja→en`), and nothing is dubbed; `--dry-run` reports it too. Dubbing the audition line when making a pack is the same: it is not dubbed, and the report says `card_line_cross_language`. Recognizing the language, comparing, stopping and listing the lines are all done by the command; when you see the report, do not ask, add the option as above and dub again. If the user wants to add a reference segment in this language themselves, see `references/character-voice.md`「Add a reference segment in this language」 for how. If the lines the user gave are in another language and they want this character to say them, dub them the same way: do not translate them into the pack's language yourself, and do not switch to another pack. A few words of another language inside a line do not stop it. The rules and how the report is written are in `references/dub.md` step 3「No accent by default.」.

The command's options, the report and the scripts inside the pack are all in `references/dub.md`; the details of stitching, failure and redo, and voice changing are in `references/dub-details.md` (`dub.md` has pointers to it in many places). Before writing the script, first read the sub-skill of this scene (the opening "Dubbing by scene"). The dubbing guidance (the last section of the pack's `SKILL.md`) has five sections: before writing the script, first read `### 这个人是谁` (who this person is) (how he would speak at this moment, his attitude toward whom), and for cross-language dubbing read `### 换语言时怎么说` (what to say when changing language) if the pack has it (the name pair, how he refers to himself, his catchphrases; a pack without it can still be dubbed across languages, see section 6); when writing the script, follow the section `### 台词` (lines), and write the acting style (`### 演法`) as cues in the script (`dub` does not hand the guidance to the model). Expressiveness (`--expressiveness`) has three layers, each later one overriding the earlier: the pack's global value, the setup's, and the one given at `dub` time. When the voice has a fixed value (the setup's or the global one), by default do not give one, and give one only with a reason, moving about 10 from the fixed value; when it has no fixed value, by default give one, choosing the value following `models/scene3.md`「Expressiveness」; within one scene the value stays the same, and different scenes need different values, using each item of a `.json` script; when several voices are such that some are fixed and some are not, or the fixed values differ, follow `models/scene3.md`「Expressiveness」›「How to choose the value」. The numbers are written in that one place only.

**Easy places to go wrong.** A few places where users often walk in and then blame the voice for being bad; at that moment do as the table says, and when handing the result back say the sentence in "What to say":

| Moment | What to do | What to say, and which better path to give |
|---|---|---|
| The recording and the lines to dub are not in the same language (a Japanese recording is passed and English lines are wanted) | Do not ask; dub by the accent-removing route (`references/character-voice.md`「Language and accent」) | These lines were dubbed across languages from a recording in another language and may carry a little of that accent; if there is a recording of this character speaking this language, hand it over and a reference segment in this language can be added |
| A dialect or accent is wanted | Write the concrete features of this accent, write the lines in its own words, do not write the name of the accent (`models/scene3.md`「Cross-language and accent」) | If it was dubbed and did not come out: write more of the features of that spot, or dub again with a different kind of cue (`references/character-voice.md`「Emotional lines」) |
| A very short line ("嗯。", "走!" — Chinese examples: "Mm.", "Go!"), and the model has a minimum number of characters | Merge it into the previous or the next line and dub again (`scenes/one-line.md` step 2 item 7) | No need to say; for one that cannot be merged and for which `dub` reports `text_too_short`, say that this line is too short and was written together with the lines before and after |
| `speech_maybe_unfinished` was reported | Do not redub | Which passage may have been cut (`references/dub.md`「Whether it was read in full」); the user listens and decides whether to dub again |
| The text in brackets in the source is words to be spoken | Before dubbing, change it to a form without brackets: brackets of up to 30 characters are removed by `dub` as stage directions (`references/dub.md`「How a line becomes synthesis」step 2) | No need to say |
| The script is written as "name: line" (`名字:台词`, with a Chinese colon) | Replace the prefix with `[voice:名字]` (`references/dub.md`「Changing speakers within a scene」) | No need to say |
| Faster or slower is wanted | Use `--speed` or the setup's speech rate, and do not write fast or slow separately as a cue (`models/scene3.md`「Speed and pauses: conclusions from listening」) | Writing fast or slow in a cue drops words and sounds like speaking without breathing |
[^b6]

A scene with several characters: `node cli.mjs dub --pack <pack directory> --pack <pack directory> <script file> --out <output directory>`, where `[voice:name]` in the script switches the character. To join the output directory into one audio: `node cli.mjs mix <dub output directory> --out <file.wav>` (if it was split into several `dub` runs, give all the output directories in order and they are joined into one file; no extra pause is added at the split, and for a breath of pause write `[pause 0.5s]` at the start of the later script); it is computed locally only and costs nothing; rules in `references/dub.md`「Stitching」.

## 7. Making a pack

The author hands in a batch of original voice recordings, and they are made into the role part of a voice pack: `node cli.mjs make-pack [<material>] --output <new directory> --name <name>`; the material can be omitted (for a long recording use `--recording`, for issuing a new version use `--previous`). The material format, the tags, the five sections of the dubbing guidance, issuing a new version, and how to make a pack from a library voice (`--no-holdout`) are all in `references/make-pack.md`; fidelity, enhancement parts, loudness, held-out recordings, the remaining details of issuing a new version, the pronunciation lexicon, the language of the skeleton, the full pack and the share file are in `references/make-pack-details.md`; making a new pack after an existing pack (clean room and duplicate check) is in `references/clean-room.md`. The command only reads and writes files, and the authoritative text is in the file header of `lib/make-pack.mjs`. To only save one setup or delete one setup (several setups), without issuing a new version: `node cli.mjs setups save <pack directory> --setup <file.json>` and `setups delete <pack directory> --name <name>` change the current version in place; the rules are in `references/make-pack.md`「Several setups (writing fixed values into the voice)」.

## 8. Connecting your own model

To use your own model (local, or another provider's service), write an adapter and hand it with `--adapter` to the commands that dub, change voice, make a pack and measure fidelity (sections 6 and 7). Four steps, one command each; the rules (the factory, the shape of what is returned, errors, what the check looks at, what `--live` does) are written only in `adapters/README.md` and are not repeated here.

1. **Generate**: `node cli.mjs adapter new <directory> --capabilities <capability,…>`, with capability names taken from the capability vocabulary (`vocab/capabilities.json`). When the model is a program such as Python, add `--kind process`: it generates a Python program skeleton, and you only need to fill in the model calls inside it.
2. **Fill in**: in the generated file, replace the line "not implemented yet" for each capability with a real call; the comment above each capability states the parameters and the return value.
3. **Check**: `node cli.mjs adapter check <directory>` looks only at the structure and does not call the model; with `--live` it really calls each capability once with a very short input and verifies what is returned (it makes real calls and may cost money: before calling it says which capabilities will be called and how many times each).
4. **Use**: `node cli.mjs dub <pack directory> <script file> --out <output directory> --adapter <directory>`.

If you already have a written program and do not want to generate a skeleton: `--adapter process --command "python my_tts.py"`. How the program talks to the adapter: `adapters/process/README.md`.