voiceoverfit 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +251 -2
  3. package/package.json +48 -4
  4. package/skills/voiceoverfit/SKILL.md +98 -0
  5. package/skills/voiceoverfit/scripts/lib/captions.js +391 -0
  6. package/skills/voiceoverfit/scripts/lib/children.js +80 -0
  7. package/skills/voiceoverfit/scripts/lib/clean.js +1468 -0
  8. package/skills/voiceoverfit/scripts/lib/cues.js +706 -0
  9. package/skills/voiceoverfit/scripts/lib/draw.js +378 -0
  10. package/skills/voiceoverfit/scripts/lib/dsp.js +165 -0
  11. package/skills/voiceoverfit/scripts/lib/edit.js +127 -0
  12. package/skills/voiceoverfit/scripts/lib/errors.js +90 -0
  13. package/skills/voiceoverfit/scripts/lib/ffmpeg.js +1516 -0
  14. package/skills/voiceoverfit/scripts/lib/level.js +245 -0
  15. package/skills/voiceoverfit/scripts/lib/musicfit.js +306 -0
  16. package/skills/voiceoverfit/scripts/lib/mux.js +288 -0
  17. package/skills/voiceoverfit/scripts/lib/out.js +1014 -0
  18. package/skills/voiceoverfit/scripts/lib/place.js +391 -0
  19. package/skills/voiceoverfit/scripts/lib/programs.js +377 -0
  20. package/skills/voiceoverfit/scripts/lib/raw.js +138 -0
  21. package/skills/voiceoverfit/scripts/lib/report-fit.js +377 -0
  22. package/skills/voiceoverfit/scripts/lib/report.js +628 -0
  23. package/skills/voiceoverfit/scripts/lib/same.js +385 -0
  24. package/skills/voiceoverfit/scripts/lib/scan.js +2291 -0
  25. package/skills/voiceoverfit/scripts/lib/split.js +233 -0
  26. package/skills/voiceoverfit/scripts/lib/version.js +5 -0
  27. package/skills/voiceoverfit/scripts/lib/voice-check.js +1990 -0
  28. package/skills/voiceoverfit/scripts/lib/voice-clean.js +1249 -0
  29. package/skills/voiceoverfit/scripts/lib/voice-fit.js +2459 -0
  30. package/skills/voiceoverfit/scripts/lib/words.js +254 -0
  31. package/skills/voiceoverfit/scripts/voiceoverfit.js +770 -0
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Emin Budak
4
+ Copyright (c) 2026 Wiro AI Inc.
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,252 @@
1
- # Temporary Holding Version
1
+ # voiceoverfit
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Fit a voice to a video. voiceoverfit cleans a recording or a text-to-speech take, lays each line of the script on its step or scene so it ends before the next one, and writes the voice on the video's timeline with captions from the script.
4
+
5
+ ```bash
6
+ npx voiceoverfit@latest take.wav --cues easyscreenshotkit-demo-acme.com/steps.json
7
+ ```
8
+
9
+ ![A take of four lines laid on the steps of a demo: two fit as they are, two were sped up a little to end before the next step](.github/assets/wave.png)
10
+
11
+ A voiceover rarely fits the cut it was written for. Text-to-speech reads a line faster or slower than you guessed, a recorded take carries hum and room noise, and every line has to be slid by hand to the moment its step appears, then nudged when it runs into the next one. The captions get typed out again from the script and timed by ear. voiceoverfit does that edit: it splits a take at the pauses that match the script, cleans it, starts each line just after its cue, and when a line is too long for its room it starts it on the cue, tightens the pauses inside it and plays it up to 10 % faster. Lines that still do not fit are flagged with how much time they need.
12
+
13
+ The voice can be your own recording or come from any text-to-speech model, and [Wiro](https://wiro.ai/explore/text-to-speech) has several.
14
+
15
+ ## Requirements
16
+
17
+ - Node.js 22 or newer.
18
+ - ffmpeg and ffprobe 4.4 or newer, Ubuntu 22.04's 4.4.2 included, built with their usual filters. `brew install ffmpeg` and `winget install ffmpeg` give a new enough one, and so does `sudo apt install ffmpeg` on Ubuntu 22.04, Debian 12 or newer. ffmpeg 4.4's noise reduction takes out less than a newer one's, and Limits says what that changes. Set `FFMPEG_PATH` to pick the ffmpeg, as a path or a name on your PATH, and `FFPROBE_PATH` the ffprobe, which is otherwise the one next to the ffmpeg `FFMPEG_PATH` names, else the one on PATH. Before any work, a run checks that ffmpeg and ffprobe start and answer as ffmpeg and ffprobe, the first line they print on their output being their version, and with `--music` that the musicfit it runs answers with its version; one that does not stops the run with what the system or the program said, and how to get one, and so does a wrapper that prints a line of its own on its output before the version, for ffmpeg, whose output is read from its first byte, an empty one too, which would go into everything read from it. With PATH not set at all, they are looked for in /usr/bin and /bin, as the system looks. A video's sound read on the video's timeline goes from one ffmpeg to the next in Matroska, and a file's sound measured for its loudness off a timeline in WAV, whose header carries its channels and, for the speaker positions a WAV header names, their layout, the meter given, where it names none, the layout ffprobe gives the file channel by channel, as for LFE and FC in the order a MOV keeps them or for FC and LFE2, or, where the meter's ffmpeg will not open WAV, as raw floats with that header's rate and channels and that layout; each goes with none of the file's tags, and Matroska and WAV are formats an ffmpeg kept to the ones users upload opens. voiceoverfit hands ffmpeg the sound it works on as raw floats (f32le). An ffmpeg that will not open Matroska, raw floats or a file's own format says so, never that the file is damaged, and so does an ffprobe that will not open a file's format, naming the ffprobe. A clean and a fit read back the WAV they write to measure it, and with a video they put a WAV under its picture and read back the MP4 they make, so a clean or a fit with a video needs an ffmpeg that opens WAV and MP4, and stops on one that does not, saying so, with exit code 1. Through one that will not open WAV, `check` measures a take of another format, a clean or a fit of it with no video writes its files with the room tone and hum of its `voice.wav` not measured, as a note says, and a fit with `--music` stops in musicfit, which reads that `voice.wav` through the same ffmpeg, with ffmpeg's own words and exit code 1. An ffprobe that will not open WAV, as `FFPROBE_PATH` can name one, has a clean and a fit write their files the same way, the note naming the ffprobe, and `check` refuse a WAV take with exit code 2, as it refuses any file that ffprobe will not open. When the system is short of open files, processes or memory to start one, the run says so and what to do, and one the system stops while it works, as it stops a program that runs out of memory with SIGKILL, ends the run with exit code 1, saying it was stopped by that signal.
19
+ - For `--music`, musicfit: voiceoverfit runs the musicfit script that `--musicfit` or `VOICEOVERFIT_MUSICFIT` names, given as the path of its `scripts/musicfit.js`, of an installed `musicfit` that leads to it, or of its package folder, else the musicfit installed with voiceoverfit, else one on PATH, always with this node: a command line is refused, nothing runs through a shell, and nothing is fetched while a run works, so with no musicfit to be found `--music` is refused before any work. The skill copied on its own has no musicfit with it: install one (`npm install -g musicfit`) or name it. musicfit 0.1.2 and older ask the loudness meter for framelog=quiet, which FFmpeg added in 6.0, so with them `--music` needs ffmpeg 6 or newer; with an older ffmpeg, such as Ubuntu 22.04's 4.4 or Debian 12's 5.1, voiceoverfit asks the musicfit that would run which it is, by its files or its version, and refuses a run with such a musicfit before any work. The musicfit installed with voiceoverfit, 0.2.0 or newer, runs on ffmpeg 4.4.
20
+ - Linux, where it is tested: on Ubuntu 22.04 with its ffmpeg 4.4.2, on Ubuntu 24.04 with its ffmpeg 6.1 and on GitHub's ubuntu-latest runner, on every push and before every release, and a release is published only once the tests pass on all three. This release has also run on Ubuntu 26.04 with ffmpeg 8.0. It is written for macOS and Windows as well, but it has not been run on either.
21
+ - Room on the disk for what a run writes, and for a long clean, which writes each step of a take past two minutes to its work folder and removes it once the next one is written, about 1.8 GB of free disk for each hour of the take while it works.
22
+ - Memory for the voice a fit holds, once, as Limits gives it: a 10 minute take of 40 lines took about 0.7 GB here on a 30 minute video, and 29 minutes of voice on that video 1.4 GB. `clean` and `check` read in chunks: 58 minutes of speech took about two minutes to clean here, in under 250 MB.
23
+ - A run needs no network access and no API key: voiceoverfit reads files on your disk, there is no speech model, and nothing leaves your machine. Its one npm dependency is musicfit, which `--music` runs.
24
+
25
+ ## What you get
26
+
27
+ ```
28
+ voiceoverfit-demo-acme.com/
29
+ voice.wav the voice on the video's timeline, 48 kHz, at -16 LUFS
30
+ mix.wav with a video or music: the voice over the video's own sound or the music, ducked under it, or the voice alone where that sound is left out
31
+ mix.mp4 with a video: the video with that mix, its picture copied as it was when an MP4 can hold it
32
+ captions.srt with a script or step notes: captions from them, timed to where each line landed
33
+ captions.vtt the same as WebVTT
34
+ phrases.json each phrase's start and end, with estimated word times (with a script or step notes)
35
+ cues.json every line's start and end in seconds and frames, its cue and how it was fitted
36
+ wave.png the take and the voice on the timeline, like the picture above
37
+ VOICE.md what was done and where each line landed, for people and agents
38
+ music/ with --music: musicfit's fit of the track, ducked under the voice
39
+ ```
40
+
41
+ - The cues come from easyscreenshotkit's `steps.json` (each step's start, and the note written on a step for whoever narrates it), launch-film's `film.timeline.json` (each clip's start), an earlier fit's `cues.json` (each line's cue and words, and the video that fit was on, found next to it or where that fit had it, to place a new take on the same cues, also into that fit's own folder, whose fit it then replaces; with that video found nowhere, the run says so, and a run into that folder is refused rather than replace its `mix.mp4` with none; where that video was an earlier fit's `mix.mp4`, as for a fit laid on such a mix's picture, it is found where that fit had it and refused as it would be given with `--video`, below), a JSON list of seconds in a file or given as the value itself (`--cues "[0, 4.5, 9]"`), a JSON file of cuts in frames at its own rate (`{"fps": 30, "cuts": [96, 225]}`), read as launch-film's check and reframekit read it, where one shot gives way to the next, so the opening shot has a cue at 0 and each cut one, or seconds typed in. Where that fit had its video is taken only for the file it was on: `cues.json` keeps its size and a hash of its first and last 64 KB, so a `cues.json` from anyone leads a fit to no other file. The step notes are the script unless you give one.
42
+ - One take is split at its pauses. Between the lines of a script a reader pauses, and each line takes about its share of the time by its share of the letters; the split picks the pauses that suit both. Word times from a speech-to-text model (`--words`) split it by the words instead. One file per line works too, each brought to the same loudness first; it has no take to split, and `--words` is refused with it. A fit's `mix.wav` or `mix.mp4` with music or the video's own sound under the voice, known by its `cues.json` or the mark the fit writes in it, is refused as the voice before any work, as `clean` refuses it: a fit would take that sound for the take's own and keep it in the lines, so give the take that fit was made from. So is musicfit's `music/fitted.wav` in a fit's folder, the music alone.
43
+ - Each line starts 0.2 s after its cue (`--lead`) and ends at least 0.3 s before the next one (`--gap`). A line too long for that starts on its cue and may end 0.1 s before the next, or as much more as a `--lead` under 0.05 s needs for the next line to start on its cue, lines keeping 0.15 s apart; then its pauses are tightened down to 0.15 s, a pause being a stretch at least 12 dB under the voice, and over a loud steady sound one where that sound holds, so words over such a sound are not cut for its pauses, then it plays faster with the pitch kept, by up to 10 % (`--max-speed`). If it still does not fit, it runs on and the lines after it move along, and VOICE.md says by how much.
44
+ - The cleaning is classic filtering, set from a reading of the take: a high-pass at 80 Hz, a notch on each line of 50 or 60 Hz hum, noise reduction learned from a quiet stretch of the take, de-essing when the esses are sharp, and gentle compression. The room is read above 80 Hz, through a steep filter so that a rumble under 50 Hz does not fill the pauses, in the quiet stretches between the words, as the middle of their own levels, and the noise reduction learns it from one of them; a stretch before the first word or after the last counts only when there is none between them, like a second of the room recorded before the first word, and never while it fades, as the last moments of music do, though one there that does not fade can give the room its level, as Limits say. A line file, and a take whose room is read at its edges, learn the noise before the first word, where the recording started on the room alone, when that holds 0.3 s or more: a quiet stretch further on can be a reader's softer words falling within a few dB of the room. Clean shortens such a stretch, and `check` of what it made reads the room in what is left of it too, from the clean.json beside the file, because a pause between the words can hold a soft sound like a breath. From that clean.json it also takes it that the clean found music or another sound under the voice, whose quiet moments clean's compression brings nearer one level than the take had them. A room read 20 dB or more under the take's quietest 5 %, where a sound holds near that 5 % for two stretches of 0.25 s or more and that 5 % sits 12 dB or more under the voice, leaves a sound under the words that its pauses do not hold, like music with one rest in it, and `check` and clean's note say so, and a fit's note that the fit cuts that sound at each line's edge; a dense take's soft syllables sit that far over its room too, but come and go, or sit within 12 dB of the voice.
45
+ - Digital silence, in what follows and in the reports, is what their reading takes for no sound at all, above 80 Hz or at its peaks, so a DC offset alone reads as digital silence too, while a model's faint floor, a gate's residue or the pauses of a cleaned take can read as a very quiet room instead, as Limits say. It is no room before the first word or after the last, like a second of it at the start of a screen recording, nor where an edit left 0.15 s or more of it in a take that holds a room in its pauses or at its edges. A take that a text-to-speech model or a noise gate left silent in more of its pauses than hold a sound is read as silent between its words, as long as a sound holds in no more than two of those pauses, or a third of them, so dropouts cut out of a take's words do not outvote its pauses. Under twenty such stretches an edit could have left them, so the voice has to fall away toward them as well, 15 dB or more under its peaks around nine in ten of them, as it does where a gate shuts or a model's words fade and does not where a mute cuts through the words, and under six of them no stretch of sound half a second long or more may stand beside them, as the room of a recording running before its first word does. With no quiet stretch of sound at all to weigh them against, six such stretches or more are taken for a gate's whatever the voice does at them, and fewer take three that the voice falls away toward, as a gate leaves them, or a voice that fades into them or dips toward silence between its sounds, as a model's does; with neither, digital silence is all the take has for pauses, an edit or text to speech alike, and its room is not measured. A line silent at both ends with no pause of its own is read as silent there when its voice fades into it and dips toward it between its sounds, as a model's line does; a recorded line padded with zeros sits on its room up to them, and its room is not measured. No room can be heard in digital silence, so no report gives it as a room tone or passes it: `check` gives it as info, and VOICE.md says no room can be heard in it and never calls it the room tone. What a clean's VOICE.md, its summary and its `clean.json` give as the room tone and the hum after, and a fit's VOICE.md, its summary and its `cues.json` as the room tone and the hum of its `voice.wav`, is what `check` of that `voice.wav` reads, by `check`'s own reading and gate with the run's report beside it: a level, digital silence, or none measured, and for a hum none found only where a search that counts heard none. Before, they give the take's room as digital silence only where the take's own reading took its pauses for no sound, and a quiet room the loudness asked for levels far down at that level.
46
+ - The near silence a recorder or a codec can leave before the room starts or after it stops, a little over digital silence, is no room either: at -80 dBFS or under and 20 dB or more under the quietest moments between the words, or 40 dB or more under them at any level where it holds steady, it is neither speech nor room in any reading, so a short line with no pause of its own has its room not measured, and a line file with a second of its room before and after its words has that room read, as the same file without that near silence has them. Near silence only a little more than 20 dB under the room, before or after a take or a line file with no pause between its words, can keep that second of room from being read, as Limits say.
47
+ - A room's quiet stretches between the words sit at one level; when one sits at the room tone and two others more than 6 dB under it, they are taken for music or another sound under the voice, which noise reduction learned from one of them would take down wherever it is soft, so none runs and `check` measures no room. Where more of them sit at the room tone than under it and those under it lie together in one part of the take, as a hum that comes on part way or a room that changes level leaves them, it is no music. A hum is still looked for under music, since a hum's lines sit on one frequency to a tenth of a percent, as notes seldom do: one found is notched out, and none found, or what the notches left of one, is not measured. A fit of such a take cuts that sound at each line's edges and leaves silence between the lines, and warns of it.
48
+ - Loudness is measured with ffmpeg's EBU R128 meter and set with one gain; a true-peak limiter holds the peaks under -1 dBTP only when that gain would push them over. `check` measures a mono file as it plays from two speakers, a file of more than two channels as its downmix to two by its layout, or as the average of all of its channels where it has no layout voiceoverfit mixes down, as its CHECK.md says, and a file of two channels as ffmpeg's meter measures the file itself, the channel that ffmpeg reads as an LFE left out.
49
+ - The captions come from the script and where each line landed, so no speech recognition is needed. A line is broken into phrases where a sentence ends (after a period, colon and the like with a space after it, so 2.5, 10:30 and acme.example stay whole), each phrase gets the stretch of speech between the pauses that suit it (by length instead when those pauses would give a phrase under a third of its share of the time by its letters, or over three times it, and from the word times when the take was split by `--words`), and each caption holds at most two lines of 42 characters, split as evenly as the words allow. A line breaks only at a space (and between words in Chinese, Japanese or Thai), so a URL, a path or a name@1.0 stays whole, and an opening mark like ¿ or « stays with the word after it; a word longer than 42 characters gets a line of its own. `phrases.json` gives the same words, marks included. Markdown, SSML tags and directions in square brackets like `[pause]` or `[laughs]` are taken out of the words; other bracketed words like `[Save]` stay. In `captions.srt`, braces become ❴ ❵ and a backslash gets an invisible word joiner after it, so players that draw SRT with libass do not take them for markup.
50
+ - With a video, the voice is mixed over the video's own sound, which dips 10 dB (`--duck`) under each line, and the mix goes under the picture, which is copied as it is: its frames, frame rate and rotation stay. An earlier fit's `mix.mp4`, known by its `cues.json` or the mark the fit writes in it, is refused as the video, given with `--video` or named by the cues file, where the mix would keep the video's own sound, as it does by default without `--music` and with `--video-sound duck`: that sound holds that fit's voice, which would go under the new lines, so give the video that fit laid its lines on, which the refusal names where a `cues.json` voiceoverfit wrote says it, also for a fit laid on the picture of an earlier fit's mix: the mark names no file, so a copy of the mix away from its `cues.json` names none. With `--video-sound drop` or `--music`, which leave that sound out, the fit takes its picture alone, and VOICE.md and the summary say so; a copy of its picture with no sound is taken so too. That fit's own voice on its own `mix.mp4`, by default, is not refused, as the mix's sound holds that voice: its `voice.wav`, a copy of it known by its mark, the take that fit was made from, as that fit's `cues.json` beside the mix says, or a clean of its `voice.wav`, as that clean's `clean.json` says. All of that sound is left out then, whatever a match of the two finds, and a warning names what that fit laid under its lines, the video's own sound or music, which goes with it, and what keeps it: the video that fit laid its lines on, given as `--video`, or `--music` with a track. With `--video-sound duck` such a run is refused. Moved or copied away from where that fit's `cues.json` says it was, the take is refused as another take is, and so is a clean moved away from its `clean.json` or from that fit's folder, and so is a new recording saved where that take was, or a clean of a `voice.wav` that a later fit in that folder has replaced, since `cues.json` and `clean.json` keep the size and a hash of all of the file they were made from and of the `voice.wav` each wrote, so a take edited in its middle at the same size is refused too, and so is that fit's `voice.wav`, or a clean's, edited after it was written, or another recording saved over it, and so is a copy of that fit's `voice.wav` known by its mark that differs from it, while that fit's `cues.json` is beside the mix; a mix away from its `cues.json` is known by its mark alone, which cannot tell a copy edited since. A file over 8 GiB keeps no such hash, so a take that large is refused on its fit's `mix.mp4` as another take is. `--video-sound drop` lays any of these on that picture alone. The voice keeps its loudness in the mix: a sound of the video's own that is louder than the loudness asked for is turned down to it, and a quieter one keeps its level. The mix is not lifted to make up for a quiet one, since that would lift the voice too, so over a quiet sound with few lines `mix.wav` comes out under the loudness asked for, and the summary and VOICE.md say so. The video's own sound keeps its place against the picture, also when it starts before or after the picture or stops before it ends. A picture an MP4 cannot hold, like ProRes, is encoded to H.264 instead, and the summary and VOICE.md say so. AAC can lift a peak a little, and by another amount at each level: mix.mp4's sound is measured after every encode, and while a true peak passes -1 dBTP it is encoded again lower by as much and half a decibel more, up to four times; where it still passes, the summary and VOICE.md give the true peak as measured, and `clean.mp4`'s sound is held so too. When the voice is the video's own sound (a screen recording with its narration), given as the video itself, as the sound taken out of it, or as that sound cleaned by `voiceoverfit clean`, its pauses cut or not, that sound is left out of the mix, so the voice is not heard twice. voiceoverfit tells the two are one sound when the voice's stretches of speech are found in the video's sound one after another, first by their loudness over time and then sample by sample, and they make up nearly all of what is heard there, a word too short to be a stretch of its own between two found ones included. Both are held against each other above 200 Hz, so the rumble under 80 Hz that `voiceoverfit clean` cuts and the lowest lines of a hum it notches out count in neither. When they make up most of it and the sound holds a little more, like an intro before the narration, the sound stays and is left out only from where the voice is first found in it to where it is last found, and the summary and VOICE.md say so. When it holds much more (lines the voice does not have, or music between them) or only part of the voice comes from it, the sound stays whole, and the summary and VOICE.md warn that what the two share is heard twice; `--video-sound drop` leaves it out. Music or another sound under all of the narration lies under every stretch the voice is found in, so it does not count against the voice; it is told instead by what the video's sound holds where the voice pauses: much more than the voice holds in its own pauses, and either rising and falling as music does or, when it is steady, by more than `voiceoverfit clean` takes a room down. It goes with the narration, so the voice is not heard twice, and the summary and VOICE.md warn of it and give its level; `--video-sound duck` keeps it, the voice in it too. A steady sound is not counted for a take `voiceoverfit clean` made (its `clean.json` next to it, or the mark it writes in the file, says so) when that clean took a room down or notched a hum out: that sound is what it took out, and its notches take a hum down by more than it takes a room down. Nor is it for a take a noise gate left silent between its words, with that sound still under them: it is the room the gate took out. A text-to-speech take, silent between its words with nothing under them, never had it, so a steady sound under it is warned of.
51
+ - With `--music`, the original track goes to [musicfit](https://github.com/MakersMCP/musicfit) with `--voice voice.wav`, so the track is fitted to the video once and the ducking stays in musicfit. The video's own sound is then left out of the mix, unless `--video-sound duck`.
52
+
53
+ `cues.json` has each line where it landed, in seconds and as frames at the video's frame rate (for a slide show slower than a frame a second, at the cues file's rate or 30, as the summary and VOICE.md say):
54
+
55
+ ```json
56
+ {
57
+ "fps": 30,
58
+ "length": 16,
59
+ "frames": 480,
60
+ "lines": [
61
+ { "n": 1, "cue": 1, "label": "Open acme.example", "text": "This is the board, every card in one place.", "cueTime": 0, "start": 0.2, "end": 2.48, "startFrame": 6, "endFrame": 74, "fit": "fits", "tightened": 0, "speed": 1, "over": 0 },
62
+ { "n": 2, "cue": 3, "label": "Click New card", "text": "Add a card, then give it a name and an owner.", "cueTime": 3.4, "start": 3.4, "end": 7.6, "startFrame": 102, "endFrame": 228, "fit": "faster", "tightened": 0.22, "speed": 1.002, "over": 0 }
63
+ ]
64
+ }
65
+ ```
66
+
67
+ The list and each line are cut short here. The file has every line, each with its cue's frame, its length, the room it had (`slot`), how far it runs over (`over`), how late the line before pushed it (`pushed`) and where it came from in the take (`source`), and the loudness and the captions. Lines that share a cue (steps that start together) and do not fit in its time together each have a part of it by their length, from where it starts to where the line has to end (`share`): such a line's `over` counts from the end of its share, and for a line after the first, `pushed` counts from its start. Once the line before them runs past all of that time, they have no share, and each counts its `over` from the end of that time and its `pushed` from its cue. A line pushed to start at the end of the video or after it is not heard: its `fit` is `lost`, and it has no `start`, `end` or frames. The last line heard, when the end cuts it, has `cut`, the seconds of it past the end. A line file that gave up some of the stretch after its last word that stands out, to fit its time, has `endCut`, the seconds of it that went. A line that starts or ends with a short sound half a second or more apart from the rest of its words has `apart`: its `first` and `last` say how far that sound stands from them, in seconds, so its `start` or `end` is at that sound. A line file over a sound that stays whose line starts well before its first word that stands out clearly has `early`, how long before that word, in seconds.
68
+
69
+ ## Clean a take
70
+
71
+ ```bash
72
+ npx voiceoverfit@latest clean take.wav
73
+ ```
74
+
75
+ `clean` takes one recording or text-to-speech take, cleans it as above, cuts pauses longer than a second down to a second (`--max-pause`), cuts the room or the silence before the first word and after the last to a moment, and sets the loudness. A pause is read as a fit reads one in a line: at least 12 dB under the voice, and over a loud steady sound where that sound holds, so a soft word a few dB over it is not cut; where the voice rises under 12 dB over such a sound once cleaned, no pause is cut, and a note says why. It writes `voice.wav`, `clean.json`, `wave.png` (the take before and after) and `VOICE.md`, which shows the loudness, true peak, room tone, hum, longest pause and length before and after, the room tone after, where it read one before, and the hum after as `check` of `voice.wav` reads them, and each cut, one before the first word or after the last with how far under the voice, and over or under the room tone, its loudest moment sat (over a hum, the room tone with its hum, where the hum is), into `voiceoverfit-clean-<name>/`. A file of a name the kits give every file of its kind (`voice.wav`, `mix.wav`, `mix.mp4`, `clean.mp4`, `demo.mp4`, `film.mp4`) is named with its folder too, so `voiceoverfit-demo-acme.com/voice.wav` cleans into `voiceoverfit-clean-demo-acme.com-voice/`, and the cleans of two fits' voice.wav go apart. `clean.json` keeps the settings the clean was given, which the fixes `check` gives use.
76
+
77
+ - `--length 30` fits the take to 30 seconds (or `1:05`, or `1:30:00`, up to 4 hours, and no more than a minute longer than the take): shorter pauses first, then a faster tempo, then silence added to the end. A take that still does not fit is cut at 30 seconds, and the summary and VOICE.md warn how much of it is lost. A longer `--length` is refused before anything is written: before any sound is read, in the dry run too, by the length the file states for its sound, and once the take is read, by the length it decodes to, as a file can state more than it holds; a file that states less than it holds is held to what it states first, and that refusal asks for a `--length` no more than a minute longer than that; a fit lays a take on a timeline of up to 30 minutes. Where `VOICEOVERFIT_MAX_SECONDS` is set, as a service that runs clean for others can set it, a take longer than that many seconds is refused the same way, and so is every clean while it is set to anything but a number of seconds over 0 in digits, like 3600, an empty value included.
78
+ - `--words words.json` takes word times from a speech-to-text model that keeps fillers, and cuts each um, uh and erm out at its edges, in an English take. It needs a JSON file with a start and an end for each word: an SRT or VTT gives a time for each caption only, so no filler is cut from one. A words file whose words run past the end of the take is another recording's, and is refused, as is one whose words fall on the take's speech hardly more than anywhere in it would and cover under half of it, or whose pauses of half a second or more between words fall mostly where the take speaks, as another take's do. Every moment the take speaks in such a pause counts, a breath or a filler the model left out of the words file too, so a take's own words are refused where such a sound sits in most of their pauses, and the refusal says to clean such a take without `--words`. Words that run from one into the next, with no such pause, are weighed by the first test alone. The word times have to be those of the take as it is now: a words file made before its head was trimmed, its times a few tenths of a second late or early, is taken, and each filler is cut where it says, which can take part of the word beside it.
79
+ - Given a video, its sound is cleaned without cutting anything and read on the video's timeline, so it stays in step with the picture also where it starts late or has a gap (as a screen recording that dropped a stretch can have), and `voice.wav` has silence there. A sound that starts before the picture, as an MPEG-TS can have it, starts `voice.wav` too, and in `clean.mp4` the picture keeps its place after it; one that runs on more than 5 s past the picture's end can be refused, and a picture or a sound that starts more than 100 s after the other, or past the file's first 100 MB, can be missed, as Limits say. `clean.mp4` is the video with the clean sound, as long as its picture, or for a video ffmpeg decodes only in part as long as the video states, its picture stopping where that part does and its sound silent after it, as Limits say; where the picture ends before the sound by the lengths the video states, the summary and VOICE.md say so, and `voice.wav` has all of the sound unless it ends inside a gap in the sound's times, as Limits say, while of a video cut short they say nothing. A video states each stream's length in its header, or, where a stream has none there, as one in an MPEG-TS, an MPEG-PS or an FLV can, by the end of its last packet, which is also where a Matroska stream that starts after the file's start ends, as such a header can give that stream's end for its length. Its AAC sound is measured and lowered as `mix.mp4`'s is, to hold its true peak under -1 dBTP, and where it still passes, the summary and VOICE.md say so. A picture of one frame over a recording, like an MP4 made of a podcast's cover given once (`ffmpeg -i cover.png -i episode.wav -c:v libx264 -pix_fmt yuv420p -c:a aac episode.mp4`, without `-loop 1`), is no timeline to keep: it is cleaned as a recording, and `clean.mp4` has that picture over the clean sound. A cover looped into a frame for every moment of the sound is a video like any other, its sound cleaned without a cut; give the sound alone to have its pauses cut.
80
+ - A fit's `mix.wav` or `mix.mp4` with music or the video's own sound under the voice is refused, as a clean would take that sound down wherever it is soft, as it takes down a room: clean the fit's `voice.wav`, which holds the voice alone and is what the mix was made from. musicfit's `music/fitted.wav` in a fit's folder, the music alone, is refused too.
81
+ - It reads a long recording in chunks, and the `voice.wav` it wrote once more, as `check` does, for the room tone and the hum after: 58 minutes of speech took about two minutes here, in under 250 MB of memory.
82
+
83
+ ## Check a voice track
84
+
85
+ ```bash
86
+ npx voiceoverfit@latest check voice.wav --lufs -16
87
+ ```
88
+
89
+ `check` measures a voice track and changes nothing: loudness, true peak, clipping, the room tone, mains hum, the longest pause, how much of it is speech, and whether one channel holds the voice alone. It writes `CHECK.md`, `check.json` and `wave.png` to `check-<name>/` next to the file (`check-voice/` for voice.wav, `check-mix-mp4/` for mix.mp4 when `check-mix/` holds the check of mix.wav, and `check-music-mix/` in a fit's folder for its `music/mix.wav`, so `music/` keeps to musicfit's files) and exits with 1 when a check fails.
90
+
91
+ The commands CHECK.md gives name the file as check was given it, and a fit's other files through its folder, quoted when a shell needs that (in double quotes on Windows, where a name with ", $, a backtick, % or ! in it, or one of PowerShell's curly double quotes, which cmd.exe, PowerShell or bash reads even in double quotes, stands in the commands as a tag like `<file>` and is named in words, as a name with a backtick does anywhere, since it would end the code it is written in, and so does a name with a line break or another control character anywhere, which would start a line of the report's own, or a character that turns text around or hides in it, which would turn the rest of a line around). A track changed since the clean or the fit that wrote it, its `voice.wav`, a fit's `mix.wav` or `mix.mp4` or a clean's `clean.mp4`, as the size and hash its `clean.json` or `cues.json` keeps tell, or one that report keeps no size and hash of, is read as a take, whatever mark it carries, or where it has a moving picture, as `mix.mp4` and `clean.mp4` do, as any video's own sound, whose pauses keep the video's timing; CHECK.md says so, and its fixes clean it into a folder of its own. A fit's `mix.wav` or `mix.mp4` with music or the video's own sound under the voice is that fit's mix all the same, changed since or not, and is checked as one, as below. Where the take reading of a fit's track finds digital silence between its words, the room tone row gives it as info, as it gives any digital silence, and CHECK.md says that the track holds that fit's lines, or can hold them, where the fit's `cues.json` names the file but it carries no fit's mark, as another recording saved over it would not; it says that the silence between its lines is digital silence a voiceoverfit fit laid there, not the room of the take or line files that fit was made of, and that this reading can take it for the room, only where a report voiceoverfit wrote still vouches for the track by the size and hash it keeps and gives that fit more than one line, as a clean's `clean.json` beside what it cut in time does, since a track trimmed or edited since keeps the fit's mark and its report's list of lines, which no longer tell what it holds, and a fit that laid one line laid no silence between lines. It can do the same where digital silence fills the pauses inside the lines of a fit whose take or line files were earlier fits' tracks, as that fit's `cues.json` beside the track says, and for what a clean made of a fit's track, as its `clean.json` beside it says, where that clean cut the track in time or cleaned a fit's `mix.mp4` of the voice alone; a clean of such a track can say so in VOICE.md, and a clean of one changed since writes no fit's mark or line times. A copy away from that report is known by its mark alone, which cannot tell an edit made since, nor whose silence its lines hold, and what a clean cut in time made carries no mark, so a copy of it away from its `clean.json` is read as any take: the row gives that silence as info all the same, and CHECK.md cannot say whose it is. For what a fit or clean made, the loudness fix changes only its level, which keeps its timing and what clean cut; a fix that has to clean the take a voice.wav was made from again (to cut its pauses shorter, or with a step `--skip` left out) gives that clean with the settings its `clean.json` keeps, `--length`, `--max-pause`, `--words` and the rest, to be run where the take is, and with that clean's `--out`, so it makes the checked folder again (`clean.json` keeps the words file and the folder as paths from the take's folder); for a video's sound that clean made, it cleans that video again, to be run where the video is. For any track a fit or clean cleaned already, the room, hum and esses fixes say what that cleaning did and give a command only for a step `--skip` left out, or for a hum heard after that cleaning, which a clean of the track with every step but the notches left out takes out, saying what that cleaning's report says of the hum: that it notched none, notched none out of line files it names, or notched another mains' hum, and that what is heard is what its notches left only where they ran on that hum's mains in the take or in every line file; only what such a clean leaves is sent to be recorded again; a room check cannot hear, in a track with no pause long enough or with quiet stretches at levels apart, as under music with rests, gets no fix; a hum found under such a sound gets the clean that notches it; a hum 50 dB or more under the voice passes, and what notches leave of one is called a trace, with no fix, but beside line files the fit's `cues.json` says it notched none out of, where such a hum is not measured; and a track with no voice is sent to check that it is the right file and not muted, unless a fit or clean made it, whose words over a loud steady sound it left in can rise less than 10 dB over that sound, or it is a recording whose sound rises over a loud steady sound in places: then the fix says so, and that no voice stands out from that sound. A track under 0.4 s, too short for an integrated loudness, is measured by the power of its loud part, as clean levels it, and CHECK.md says so.
92
+
93
+ A fit's `voice.wav` sits on the video's timeline, so no pause in it is held to `--max-pause`, between its lines or inside one, and its longest pause row calls that pause a gap between lines only where no line reaches more than a tenth of a second into it; the fixes CHECK.md gives keep its timing; check knows it by the fit's `cues.json` next to it while the file holds what the fit wrote, or by the mark the fit writes in the file's comment tag, which a copy keeps, and so does `clean --max-pause 0` when it cuts nothing in time. The mark names no file of yours, the video included: it says the track is on the timeline of its video, or of its cues, as a clean's mark in the `voice.wav` and `clean.mp4` it makes of a video says they are its video's sound, and the `cues.json` or `clean.json` beside the file names the video. The mark also says where each line has its words, names the cleaning steps `--skip` left out, and says when the take had music or another sound under the voice and when the fit cleaned nothing (`--no-clean`), so a copy is read as the fit's own `voice.wav` is, and its fixes give the fit again without those steps, or, for a room the lines' own pauses hold, the clean the fit did not do; it does not say that the fit's take or line files were earlier fits' tracks, nor which line files a hum was notched out of, which only that fit's `cues.json` says, as Limits say. A `clean --max-pause 0` of it writes that mark again with what it did. The silence between a fit's lines is the fit's, so its room is read in the lines alone, in their own steady pauses of 0.25 s or more among their quietest moments, never in the margins around a line's words, where a breath or a word's decay sits; lines tightened or sped up may hold no such pause, and then the room, a hum the fit left in on request, music the fit found under the take, and for line files whose words all lie on digital silence that silence, are given as the fit read them, from its `cues.json`, that digital silence as info, and for a copy away from it the room is not measured; the note of a clean of the track says only what it read in the track, that no pause inside a line is long enough to learn the room's sound from, where none of a quarter of a second or more lies inside a line, or that the room's sound was not learned, and that no noise reduction ran, and of the fit no more than that it cleaned nothing, where its `cues.json` says so (`--no-clean`); where that fit's take or line files held earlier fits' lines, as its `cues.json` says, that clean's VOICE.md can say so, where it reads those lines' pauses as that silence, as Limits say. Where the fit cleaned nothing (`--no-clean`) and its reading of the take's room stands in, a room that check warns of or fails gets the fit run again without that flag as its fix, since a clean of the track has no pause in its lines to learn the room in. A line the fit laid whole because its file held no voice that stands out from the steady sound under it, as its `cues.json` says, gets a warning on the voice row and a fix that says so. CHECK.md writes its commands for an installed voiceoverfit (`npm install -g voiceoverfit`); with npx they start with `npx voiceoverfit@latest`, and with the skill with `node <skill>/scripts/voiceoverfit.js`. A video's own sound keeps its pauses too, since they are the video's timing. A fit's `mix.wav` or `mix.mp4` with music or the video's own sound under the voice, changed since or not, and musicfit's `music/mix.wav` in a fit's folder, whose size and hash that fit's `cues.json` keeps as it does its own mix's, is checked only for loudness, true peak and clipping; CHECK.md says where it changed since, never that it is on its fit's timeline then, and its fixes run the fit again rather than clean the music, saying that a fit run again into the fit's folder is refused while a mix changed since is there, or say why a mix over a quiet sound of the video's own is under its loudness; `music/fitted.wav`, the music alone, has no voice to check and is refused. When check is given `--lufs`, every command in its fixes keeps it. A finished video's sound and picture are measured by [launch-film](https://github.com/MakersMCP/launch-film)'s `check`, which writes to `check/`. Where a fit's `mix.mp4` holds the voice alone, it is silent before its first line, between its lines and after its last, stretches launch-film warns of and fails a video they fill half of, so the fit's VOICE.md gives that check with them as `--allow`, as the fit laid its lines; over a sound of the video's own, VOICE.md gives the same stretches for where that sound is silent, or so quiet that launch-film calls it silence, as a screen recording's muted track can be, and CHECK.md of that mix gives launch-film's check with them while the mix is as the fit wrote it, as the size and hash the `cues.json` beside it keeps tell, their times being the fit's; of a copy away from that `cues.json`, known by its mark alone, which cannot tell whether it was trimmed since, it gives them as the fit's times, which hold only while the copy is as the fit wrote it. `--allow` passes whatever those stretches hold: a black or still picture too, which launch-film's check without it shows, and, where the last line ends before the video does, so that the last stretch runs to its end, the end of a video ffmpeg decodes only in part, whose picture stops before the end its header states, as Limits say.
94
+
95
+ ## Use it with your agent
96
+
97
+ voiceoverfit ships as an [Agent Skill](https://agentskills.io). Install it once and your agent runs it by itself when a video needs a voiceover that fits:
98
+
99
+ ```bash
100
+ npx skills add MakersMCP/voiceoverfit
101
+ ```
102
+
103
+ That covers Claude Code, Codex, Cursor and the other agents the [`skills`](https://github.com/vercel-labs/skills) CLI supports. In Claude Code you can add it as a plugin instead:
104
+
105
+ ```
106
+ /plugin marketplace add MakersMCP/voiceoverfit
107
+ /plugin install voiceoverfit@voiceoverfit
108
+ ```
109
+
110
+ In GitHub Copilot CLI it takes the same two steps:
111
+
112
+ ```bash
113
+ copilot plugin marketplace add MakersMCP/voiceoverfit
114
+ copilot plugin install voiceoverfit@voiceoverfit
115
+ ```
116
+
117
+ Then ask as usual:
118
+
119
+ > Put my voiceover on the demo video, one line per step
120
+
121
+ > Clean up this recording for the podcast
122
+
123
+ The skill carries its own script and needs no API key. It installs nothing; for `--music` it runs a musicfit installed on the machine (`npm install -g musicfit`), or the one `--musicfit` names.
124
+
125
+ ## Use it from the command line
126
+
127
+ ```
128
+ npx voiceoverfit@latest <voice> --cues <cues> [options]
129
+ npx voiceoverfit@latest clean <voice> [options]
130
+ npx voiceoverfit@latest check <voice> [options]
131
+
132
+ --cues <cues> steps.json, film.timeline.json, an earlier fit's cues.json, a JSON list of seconds
133
+ (a file, or the list itself like "[0, 4.5, 9]"), a JSON file of cuts in frames
134
+ like {"fps": 30, "cuts": [96, 225]}, or 0,4.5,9
135
+ --script <file> one line per cue; [n] at a line's start puts it on cue n
136
+ --video <file> the video the voice goes on (default: the one the cues file goes with); writes mix.wav and mix.mp4
137
+ --music <file> a track for musicfit to fit to the video and duck under the voice (musicfit 0.1.2 and
138
+ older need ffmpeg 6 or newer)
139
+ --musicfit <file> the path of the musicfit script to run, or of its package folder, run with this node
140
+ (default: VOICEOVERFIT_MUSICFIT, the musicfit installed with voiceoverfit, else musicfit on PATH)
141
+ --hit <time> with --music: where the music's drop lands
142
+ --length <time> fit: how long voice.wav is when there is no video, 1 s to 30 minutes (default: the length
143
+ the cues file states, else half a second after the last line); clean: the length to fit
144
+ the take to, 1 s to 4 hours and no more than a minute longer than the take
145
+ --lead <s> how long after its cue a line starts (default: 0.2)
146
+ --gap <s> the least time between a line's end and the next cue (default: 0.3)
147
+ --max-speed <n> how much faster a line (or with clean --length, the take) may play, 1 to 1.25 (default: 1.1)
148
+ --duck <dB> how far the video's own sound dips under the voice (default: 10)
149
+ --video-sound <how> duck or drop the video's own sound; keep, as musicfit says it, is duck (default: duck;
150
+ drop with --music, or when the voice is that sound)
151
+ --words <file> fit: word times from speech-to-text to split the take by the words of a script or
152
+ step notes (JSON, SRT or VTT);
153
+ clean: a JSON file with a time for each word that keeps the fillers
154
+ --fps <n> frame rate for frame numbers and times in frames, 1 to 240 (default: the video's when it
155
+ is 1 to 240 fps, else the cues file's: steps.json, an earlier fit's cues.json or a file
156
+ of cuts; 25 on a launch-film timeline, else 30)
157
+ --lufs <n> fit and clean: loudness target, -40 to -5 (default: -16; -14 for social video);
158
+ check: the loudness the track should have (default: none, only reported)
159
+ --max-pause <s> clean: pauses longer than this are cut to it (default: 1; 0 keeps them all,
160
+ unless --length needs them shorter);
161
+ check: the longest pause before a warning (default: 2)
162
+ --skip <steps> leave out highpass, hum, denoise, deess, compress or pauses
163
+ --no-clean place the lines as they are
164
+ --out <dir> where to save (default: ./voiceoverfit-<name> for a fit, after the folder easyscreenshotkit
165
+ or launch-film wrote the cues file in, else after the voice; ./voiceoverfit-clean-<name>
166
+ for clean, with the file's folder for voice.wav, mix.mp4 and the other names the kits
167
+ give every file of its kind; either with -2 after it when that folder holds the other's
168
+ run; check-<name>/ next to the file for check)
169
+ --json print the report as JSON instead of a summary
170
+ --dry-run check the arguments and say what would be done, reading no sound
171
+ ```
172
+
173
+ Times are seconds unless they end in `f`, which counts frames at `--fps` in a fit (by default the video's rate; `clean --length` takes no frames), or are written as minutes like `1:05` or hours like `1:30:00`. The voice can be any file ffmpeg reads and mixes down to one or two channels, given by its name, a video's sound included; a folder of line files gives the files in it whose names end in .wav, .wave, .mp3, .m4a, .aac, .flac, .ogg, .oga, .opus, .webm, .aif, .aiff, .caf, .wma, .mp4, .mov or .mkv, in name order, and leaves out the others and those whose names start with a dot, so what a fit or a clean wrote into that folder is taken as lines by the next fit of it, a fit's `voice.wav`, `mix.wav` and `mix.mp4` and a clean's `voice.wav` and `clean.mp4`: give a run on a folder of line files another folder with `--out`, so it writes none there. A fit's mix with music or the video's own sound under the voice in such a folder is refused, naming the folder: move that fit's files out of it, or give the line files a folder of their own. One of those names that is no file, as a folder or a named pipe, is refused, and so is a cues file, video, music, words file or script, or a voice other than a folder of line files, given by a name that is no file, before anything reads it. voiceoverfit reads files, not addresses: a voice, cues file, video, music, words file or script given as `https://...` is refused, so download it first. The exit code is 0 when the run worked, 1 when it failed (or a check failed) and 2 when an argument is wrong: a file that is not there, or that is no file, as a named pipe, an `--out` it cannot write to, or one that does not suit the run, like `--length` next to a video, a script with more lines than cues, a cues file that is not JSON, or a file ffprobe cannot open or finds no sound in, or one with samples that are not numbers where the run counts them, as a fit counts those of a video's own sound only up to the end of its picture, where it mixes that sound, though it can read up to 10 s past it, and not at all where `--video-sound drop` or `--music` leaves it out, or a take or a line file with its channels laid out in a way ffmpeg will not mix down, also when that shows only once the files are read; a file ffprobe opens that ffmpeg then cannot read, as one an ffmpeg kept to some formats will not open, or one whose sound it cannot decode at all, as when every frame of it is damaged, ends the run with 1, and one it decodes only in part is read as that part, or refused as damaged, with 1, where a stretch the run reads lies in the damage, as Limits say; music given with `--music` in which ffprobe finds no sound stream, as a video with no sound, is refused with 2 before any work, in the dry run too, and music whose sound stream ffprobe finds is musicfit's to read, so music whose sound holds no samples, as a WAV of its header alone, or only silence, ends the run with 1 there, as music whose channels ffmpeg will not mix down does, while music with samples that are not numbers is not refused, as Limits say; and 2 when the ffmpeg, ffprobe or musicfit it would run is not there, is no program this machine can start or does not answer as itself, which it finds before any work; one the system has too few open files, processes or memory to start, or that gives no answer in 120 s, ends the run with 1, as another try can work, and so does an environment too large to start one with, which needs fewer or shorter environment variables. `--dry-run` finds those the files' headers show, and reads no sound, so samples that are not numbers, and a layout ffmpeg will not mix down, show only in the run. What it prints as text, the summary, the progress lines, the dry run and every message, gives each name on one line: a line break, another control character or a character that turns text around in a name stands as ?, so no line of its own starts with a name's words. Every message comes after "voiceoverfit: ", but one about an ffmpeg, ffprobe or musicfit the run cannot use that starts with voiceoverfit's own name, as "voiceoverfit needs ffmpeg" does, so no file's name can make a message read as one of those. `--json` gives the names as they are, in JSON strings, but in the refusal of line files whose count differs from the lines or the cues, which names them on one line there too, and in check's hum and room rows, which write a line file's name as CHECK.md does and name it by its line, or count the files, where a name is not a plain one, as with a slash, a backslash, a quote, a backtick or a control character in it, or where two of the files share a name. VOICE.md and CHECK.md write each name on one line too, a line break or another control character in it as a space and a character that turns text around or hides in it as ?, and VOICE.md quotes the script's words so, but for the zero width non-joiner and joiner and the direction marks, which it keeps, as Persian's half-space and an emoji made of others joined need them, the flags of England, Scotland and Wales, which it keeps whole, and the zero width space, the word joiner and the invisible operators, which it leaves out, as Thai and Khmer text can hold the first two between its letters. A zero width no-break space (U+FEFF) in a line's words is read as a space, for VOICE.md and the captions alike. VOICE.md's table cuts a long line short, ending it with ..., and a flag or an emoji made of others that the cut falls inside is cut with it, a flag's tags before the cut standing as ?.
174
+
175
+ An output folder that is there already keeps what is not voiceoverfit's. A run replaces only the files an earlier voiceoverfit run wrote there, which that run's `cues.json`, `clean.json` or `check.json` lists with the size and a hash of each of them and of itself, and only while each holds what that run wrote, as that size and hash tell: a file the user changed since, such as `captions.srt` corrected by hand or a `mix.mp4` trimmed in place, is not replaced or removed, as below. A report that keeps no such size and hash, as none voiceoverfit writes, vouches for none of the files it lists. It removes the ones of those it does not write again; the summary names what it removed, whose fit or clean it replaced when that was of another take, other cues or another recording (one of the same name from another folder too), and whose check of another file. `music/` only ever loses musicfit's own files, and one that is a link is left alone. A run is refused before any work, in the dry run too, when a file it would write is there already and no such report lists it, such as your own `captions.srt` or launch-film's `wave.png`; when a file an earlier run wrote there that it would replace or remove, or that run's report, no longer holds what that run wrote, as the size and hash the report keeps tell, naming the file: move it elsewhere first, or where it is the report, that run's files with it, or give the run another folder with `--out`; when that run's report keeps no size and hash of the files it lists: move them elsewhere first, with that report, or give another `--out`; when it would write over one of its inputs (an earlier fit's `cues.json` given as `--cues` is read whole first, and may be replaced), replace another tool's report, write through a `music/` link, or put musicfit's files into a `music/` folder that holds other files; and when it would mix a check with a fit in one folder. The new files go in only once the ones they replace are moved aside, so a file another program holds open stops the run and leaves the folder as it was, and so does a file that turns up under one of the run's names while it works and no voiceoverfit report there lists, which stays as it is, a file of the earlier run's that changes while it works, and that run's files where its report is made into something that is no voiceoverfit report, or taken away, while the run works, these three ending the run as a refusal does, with exit code 2, the last naming that report and giving another `--out` as the way out; the files of a voiceoverfit run that ended there meanwhile are an earlier run's.
176
+
177
+ Some runs:
178
+
179
+ ```bash
180
+ npx voiceoverfit@latest take.wav --cues steps.json
181
+ npx voiceoverfit@latest lines/ --cues launch-film-acme.com/film.timeline.json --lufs -14
182
+ npx voiceoverfit@latest take.m4a --cues 0,6.5,14,21 --script script.md --video cut.mp4
183
+ npx voiceoverfit@latest take.wav --cues steps.json --music track.mp3 --hit 24
184
+ npx voiceoverfit@latest clean episode.wav --max-pause 0.8
185
+ npx voiceoverfit@latest clean interview.mp4
186
+ ```
187
+
188
+ Installed globally (`npm install -g voiceoverfit`), the command is `voiceoverfit`. npx keeps the copy an earlier run fetched, so `npx voiceoverfit@latest` is how you get a newer version. It needs Node 22 or newer and ffmpeg 4.4 or newer, with ffprobe, and for `--music` musicfit, as [Requirements](#requirements) says.
189
+
190
+ ## How it works
191
+
192
+ 1. Reads the take in chunks with ffmpeg and keeps, for every 10 ms, the level of each channel above 80 Hz and of the band above 4.5 kHz, the peaks, and where the sound sits flat on its peak. From those come which channel holds the voice, where it speaks and pauses, the room tone, and the quiet stretches. A file of more than two channels is brought to two by its channel layout, as a player mixes it down, the centre and the surrounds about 3 dB down into both sides and a 5.1's LFE left out, and turned down where its channels at their peaks could add up past full scale; with no layout, as a recorder's poly WAV with a plain header has it, all of its channels are averaged, since nothing says which holds the voice, and so are they in a layout voiceoverfit has no mixdown for, as a 5.1 in the order a MOV can keep it (FL, FC, FR, BL, BR, LFE) or 5.1.2(back), its LFE among them; the reports say which of the two it was. Its clipping and true peak are read on each of its channels as recorded, before any of that, so one voice on several microphones is never called clipped where no microphone was, and a near microphone that clipped is found though the others hold the same voice; the reports name the channels clipped.
193
+ 2. Looks for mains hum: an averaged spectrum, searched for lines near whole multiples of 50 or 60 Hz that stand out from the bins around them. A hum's lines hold from one stretch to the next and sit on whole multiples of one frequency, the mains', so only lines that hold and sit on one fundamental within 1 % of 50 or 60 Hz count. The fundamental is read off the first four lines, each by how far it stands out, since a weak line far up the multiples may be a voice's own; those low lines count when they are near it, and higher ones when they sit within a tenth of a percent of their multiple of it. It takes two lines at least that stand out clearly, one of them the first, second or third, or in the pauses the first alone with another, or four of them; or, in the pauses, the line on 50 or 60 Hz alone when it stands 15 dB over the sound around it and holds through four parts of them. The hum's level is read from its first four lines and those higher up that stand out clearly. It looks first in the quiet stretches. With 0.2 s of pause or more that held no such lines, that line on 50 or 60 Hz standing out both in the pauses and under the speech is a hum, when there are 4 s of speech to hear it under; with less pause than that, it is looked for under the speech, where the speech is, 4 s of it or more, and in a fit's `voice.wav` under its lines, where what it listens to there holds 4 s of speech or more, and under less it is not measured, whatever the silence around the words: none is given only where a search ran and heard none, also beside a hum the fit notched out. Where a hum is loud enough to fill the levels above 80 Hz and leaves under 4 s of speech there, where the voice speaks is read above 300 Hz, over the hum's strong lines. In a track silent in its pauses, a gate's or a suppressor's, it is looked for under the speech as well. Once found, the room under it is read through a notch on each of its lines. A line heard under the speech alone that sits within 16 dB of the voice is the voice's own, held at one pitch, not a hum, when its strongest line swings 3 dB or more from one part of the speech to the next, as a voice rises and falls with its syllables and a mains hum does not. A hum heard under the speech is notched on its first three lines whether each stood out there or not, since the voice hides all but the strongest of them. Music under the voice does not stop the search, since notes seldom sit on those lines. Where those find none, a hum that comes on part way, like a fridge's, is looked for in the take's own quiet, read stretch by stretch by its own level, in those 6 dB or more over the room and 12 dB or more under the voice, wherever they lie and in a take of any length; and then under the speech, in up to 16 blocks of 6 s spread evenly through the take, which finds one under a gate or one in a part with few pauses, also from its first line alone when that stands 25 dB out. Where it is heard in part of the take, the report gives the first and the last pause, or second of speech, that hold it; one found in the take's own quiet is given no part when the first and the last of that quiet both hold it. Once found it is notched out of all of the take, which takes nothing where it is not. Line files too short to look in alone are looked at together where they hold 4 s of speech between them, a hum being one recording's mains, and a hum found so, or in another line file, is notched out of them and the room of each is read again under it, but for a file whose silence around its words the reading takes for a model's, which is left out of that search and of those notches; where a line file had none notched out of it, the fit's summary and VOICE.md name those it was notched out of and `cues.json` keeps them, and the note names every line file no search heard and says the hum found in the others was not notched out of it. Line files recorded on two mains can hold a hum on 50 Hz and another on 60: a file whose own search finds its hum has that hum notched out of it, a file too short to look in alone is given the hum of the first line file whose own search found one, else the one found over the short files together, which can be the other mains', and the summary and `cues.json` name both, VOICE.md giving each hum's step with the files it was notched out of, and a note naming each such short file and the file whose hum it was given.
194
+ 3. Runs the cleaning in one ffmpeg pass. A quiet stretch goes through it first and is cut off after: the noise reduction learns the room from it, and it ends a whole number of hum cycles in, so the narrow notches have settled and meet the take in phase.
195
+ 4. Splits the take into lines by dynamic programming over its pauses, scoring each choice by how long the pauses are and how well each line's time matches its share of the script's letters.
196
+ 5. Places the lines and fits the long ones, cutting pause middles with 15 ms crossfades and raising the tempo with ffmpeg's atempo.
197
+ 6. Sets the loudness, mixes, and writes the files into a hidden folder, moving them into the output folder only once all of them are made, so a failed or stopped run leaves nothing half written. A run killed outright (SIGKILL, or a machine out of memory) cannot remove its hidden folder; a later run in the same place removes it once that run is gone and nothing in the folder has changed for 15 minutes. A run that could not put back what it had moved aside (a file held open, say) keeps its folder as `voiceoverfit-kept-<number>-<code>` (like `voiceoverfit-kept-48213-3fa9c1`) with what it holds, and says so; no later run removes that one, and a run in that place names it.
198
+
199
+ ## Limits
200
+
201
+ - The filters are classic ones. They take out steady noise, hum, rumble and harsh esses; reverb, other voices and music under the voice stay, and a clipped recording stays clipped. VOICE.md and CHECK.md say so when it matters. Music under the voice with no rest in it, its soft passages all at one level, reads as a room, and so does music under a take too short or with too few pauses to show the music's rests, a line of 15 or 25 s, say: noise reduction learned from it takes it down wherever it is soft, so clean such a take with `--skip denoise`. Music or another sound with no rest in it that starts part way, after the first sentence, and plays on under the words reads as speech from where it starts and is not named as music: `check` passes the pauses under it, clean keeps them, its VOICE.md giving the longest pause as that of the rest of the take, and a split by pauses, by the script too, goes by the wrong pauses, one line holding several sentences while others hold pieces of one, where the note that the split may be off need not come and the warning on a line that runs over says to shorten it. Give such a take `--words` with the script, or one file per line. A room within 30 dB of the voice, where it can be measured, has that said in check's fix and in the notes of clean and a fit, also where `--skip denoise` or `--no-clean` leaves it under the words; where no pause is long enough to measure it, the notes say no noise reduction ran, and VOICE.md names the line files whose room was not measured.
202
+ - Over a steady sound within 30 dB of the voice, as ffmpeg 4.4's noise reduction leaves one, or `--skip denoise` or `--no-clean` keeps it, a pause in a fit's line or in clean's take is where that sound holds, its 50 ms levels within 4 dB of that sound as it is in the 3 s on either side, so a word a reader lets fall a few dB over it stays with its line and is not cut, and a sound that rises during a long take is held at the level it has there. So it is where the noise reduction took such a sound down: a pause is where what it left holds, since soft words it took down with that sound stand over what is left about as they stood over the sound, and check reads what clean made of such a take so, by its `clean.json`.
203
+ - A room that swings more than those 4 dB, as traffic or a fan that varies does, or as a noise reduction leaves one, which widens a room's swing, is read by how far it rises apart from the words: before the first word and after the last, a stretch that stands over it half a second or more from any louder word, or after the first word a second or more for a syllable (under a quarter of a second as recorded, under 0.1 s in a take a noise reduction cleaned, whose swings are brief), is the room's, and where the room heard apart from the words swings, half of it standing a dB or more over its quietest moments, those 4 dB rise to the highest such stretch of 0.1 s or more, up to 8 dB as recorded and 18 where a noise reduction ran, so a line starts at its first word and a long pause is read whole. In a room whose sound holds, such a stretch is a sound of its own, a breath or a rustle, and raises nothing; in a room that varies, a breath or a rustle apart from the words is taken for its swing, so it sets the level soft words have to clear, up to those 8 dB, or 18 once cleaned, and the note on a room that swings then gives its height. A stretch the take as recorded holds over the room for under 40 ms, as a mouse's click or a keystroke does, is no word and no swing in `check` of the take, in clean and in a fit, also where a noise reduction has spread it past 40 ms toward the words, and so is a burst of typing apart from the words; only what it spread to within about 0.15 s of a word can stay with that word, and `check` of what clean made reads the words where clean kept them, from its `clean.json`. Over a loud room, typing that starts within about 0.15 s after a word, or ends that near the next one, reads as part of that word for its whole length: clean keeps it in the pause, `check` counts it as speech, and a line starts or ends with it, its captions too, nearly two seconds from its words, with no note to say so. A room that swings past 8 dB as recorded, or 18 dB once cleaned, has its crests read as words: a line over it can start or end on one, a second or more from its words, and its long pauses are kept. Where the room left under the words swings past 6 dB, clean's note, and a fit's of line files, say that words within that of it can be cut or left out; a fit of one take reads that in its lines alone, which seldom hold enough of the room to show it. Between the first word and the last such a stretch is a soft word as recorded, however long, as a phrase a reader says 10 dB softer a few dB over a drone, and the room's in a cleaned take; so as recorded a swing of the room in a long pause there counts as a word where it rises over the swing the room shows before the first word and after the last, as in a take that holds none of its room there. Words softer than that swing cannot be told from it, and a soft word on its own before the first word or after the last, that far from any louder word and under the threshold a plain reading has, 8 dB over the room or 12 dB under the voice, is taken for the room there. Crests that follow one another within half a second reach the first word one from the next, so a line file over brown noise 12 dB under the voice, kept with `--skip denoise` or `--no-clean`, can start at the first of them, up to 1.5 s before its words, and its note and its row in VOICE.md say how long before its first word that stands out clearly it starts. After the last word, a crest of such a room within half a second of it keeps the line going up to it: a line file over pink noise swinging 6 dB ran 0.42 s past its last word on ffmpeg 8.
204
+ - A split by pauses over a steady sound the noise reduction took down takes a moment under 0.15 s that stands less than 8 dB over what it left, where the take as recorded held only its room, for that room and no word, and a line file or a take fitted as one line takes any moment that short before its first word so: one run of ffmpeg 8's noise reduction leaves 50 ms of a pink room 5 dB over the rest here and there, and a split with the script started a line 0.7 s before its first word there. A split by pauses with a script chooses among such pauses, so soft words at the end of a sentence neither lengthen the pause after it nor pass for the pause between two lines, and so does one with no script where that sound, read in the take's pauses, sits within 20 dB of the voice: there the plain reading's threshold, 8 dB over the sound, takes a reader's words for pause, and over a drone 14 dB under the voice found a pause of 10 s in continuous narration. Further from the voice a split with no script has the pauses' lengths alone to go by and reads them as before, a sentence's last sound fading into the pause after it counting as pause where that sound stays (see the point on a split with no script, further on, for where the noise reduction took that sound down); a fit keeps at least the stretch the split gave each line, its word times or the speech between the pauses it was cut at, and a take fitted as one line keeps the word times given with `--words`, also where the noise reduction took that sound down. On a quiet room a line keeps what sound its word times reach into, 50 ms or more 10 dB over the room, and a word timed early into a silent pause adds nothing. Music or another sound under the voice is no steady sound, and its lines are read as they come.
205
+ - A breath before the first word, after the last or in a pause, and a mouse's click or a keystroke that holds 40 ms or more over the threshold as recorded, as a loud one does, reads as a word: a line then starts or ends with it, and clean keeps it with the words, a breath in a pause with up to a second of the pause on either side. A note, the line's row in VOICE.md and `cues.json` say where a line starts or ends with a sound under 0.6 s long, or stretches of sound that add up to less, as a cluster of keystrokes can read, half a second or more apart from the rest of its words, that stays more than 6 dB under the line's voice, and the line file can be trimmed to its words where that sound is none; a word said at the line's own level before a pause of its own is not flagged, and nor is a click or a keystroke as loud as the voice, which reads as that word would.
206
+ - In one run, the noise reduction of ffmpeg 4.4 takes out a third as much as that of ffmpeg 8, or less, so with 4.4 it runs up to three times over its own output, as many times as bring the room nearest the reduction ffmpeg 8 makes, while the speech keeps its level, but for words said a few dB over the room, which each run takes further down; where the runs take the room of the whole take down more than 6 dB past that reduction, as over white noise, it runs once fewer. VOICE.md says in how many runs it ran, beside the room before and the room `check` of voice.wav reads after, and for line files how far the room came down over all of them, as measured in each cleaned file, and in up to how many runs. Its step says it took the room noise down where its own reading of the cleaned take, before any cut, reads the room lower; `check` of voice.wav reads the stretches the clean left, so the After beside that step can read the room at another level, louder than Before too. A noise reduction that leaves a room within 30 dB of the voice no quieter, as ffmpeg 4.4's can under a loud steady sound, takes down nothing but a reader's soft words near that sound, so it is left out and the take cleaned again without it, and VOICE.md says so. On ffmpeg 4.4 a drone within about 30 dB of the voice comes down by a few dB or not at all, while a broadband room such as pink noise can come down as far as on ffmpeg 8. Where the check runs on ffmpeg 4.4 or 5, its fix for such a room in a take says that ffmpeg 6 or newer takes more of it out where the runs a clean would choose, tried where it would learn the room, take it down 6 dB or more less than it asks for, and by how much: three runs can take a pink room 24 dB under the voice down further than one run of ffmpeg 8, and leave a drone 14 dB under it as it was.
207
+ - The runs of ffmpeg 4.4's noise reduction leave a pink room in bursts a third of a second apart, which a reading of the cleaned take takes for words, so on 4.4 the readings lean on the take as recorded. A fit reads where the words of a line file or a take fitted as one line are as the file was recorded, keeping the soft words that stand over the room the runs left, and such a line can run on about 0.9 s past its last word over a steady pink room, or 0.6 s into one that swings as traffic does, and to its file's last sound, with the note of a sound that stays, where the runs take the room down only a few dB. The lines of a take split at its pauses have their edges where the cleaned take reads them, the room's swings set apart from the words, and are tightened by their pauses as the take was recorded, where a sentence's soft end inside a line reads as part of the pause after it and can go with that pause, as a note says. Clean reads the take's words where it speaks as recorded and the cleaned take shows them too, its end run on through the soft words the runs left standing, and cuts the pauses between them; its `clean.json` says where it kept the words, and `check` of what clean made reads its speech and pauses there. That check reads the room near the quietest moments of what clean made, which the runs leave uneven, and where its reading sits more than 6 dB under the room clean read in the take it cleaned, before any cut, as in the 0.3 s kept before the first word, where the denoiser starts quieter than it goes on, it gives that clean's reading, and says so, and so does clean's VOICE.md after; where the clean.json beside it says that clean found no music under the voice, check does not take that unevenness for music.
208
+ - Words that fall within about 4 dB of a steady sound under the voice cannot be told from it: a split by pauses can then go by the wrong pauses, a line or a take fitted as one line can lose them at its edges, and clean can cut them with a pause or with the silence before the first word or after the last, so give `--words` to fit such a take, `--max-pause 0` to clean it with every pause and that silence kept where `--length` does not need them shorter, and listen at the lines' edges in wave.png. Words said softer than such a sound go down with it where the noise reduction takes it down: a line file whose last words fell 8 to 23 dB under a drone lost their last second so. The note on a loud room says so where the noise reduction took one down, and VOICE.md that a fit's lines start and end where the words stand out from what it left. On ffmpeg 4.4 each run of the noise reduction takes words said a few dB over the room further down, as its step says: three runs over pink noise 27 dB under the voice left such a word 10 to 16 dB quieter than ffmpeg 8's one run did. Where that sound stays under the words once cleaned, a fit's note and clean's say so, and VOICE.md says a fit's lines start and end where the words stand out from it. A line file, cut around its line, starts there at its first word that stands out from that sound, so a softer word before it can be lost, and runs on after its last such word to its last sound, past the near silence a recorder can leave at its end, which keeps such words at its end; a line too long for its time gives that stretch up first, its captions end at that word, its note says so, and VOICE.md, the summary and `cues.json` (`endCut`) say how much of it went: `--words` splits one take only, so trim a file that holds more than its words.
209
+ - A take whose words sit over a steady sound within about 12 dB of the voice shows no pause to tighten, so a long line of it plays faster and runs over rather than lose words, and clean cuts no pause in it, as its note says. A line whose words do not stand out from the sound under them is laid whole, as a note says, since where they start and end cannot be told, and so is one where only a stray syllable or two do, and a take fitted as one line, and a line file, whose voice rises under 10 dB over that sound once cleaned, all of its sound then, past the near silence at its ends. So is a line file, or a take on one cue, in which nothing rises 10 dB over the steady sound under it as recorded, though its sound rises over that sound in places, as words 6 to 10 dB over a loud fan do; a take to be split at its pauses shows none then and is refused, and `check` and clean say no voice stands out in such a file, rather than that it may be silent or muted. One whose voice rises 10 to 12 dB over it, with no pause to read the room in, can start where that sound starts, its reading's threshold sitting 12 dB under the voice: a line file of one sentence over a drone 11 dB under the voice started 0.19 s before its first word. Where such a sound stays, the compressed words can rise less than 10 dB over it, and then check of the fit's or clean's track and a clean of it find no voice in it, and say why.
210
+ - Digital silence is what the reading takes for no sound at all, so a model's faint floor, a gate's residue, the pauses of a cleaned take, and what a hum's notches ring into a gate's silence, at about -80 dBFS, can read as a very quiet room instead: `check` gives it at its level and can pass it, and where the take's room as recorded read as digital silence, a clean's or a fit's VOICE.md gives that level after, as `check` of voice.wav reads it, beside digital silence before; where digital silence was all the take had for pauses, VOICE.md says its room tone is not measured, and `check` of voice.wav can pass such a room. Before, VOICE.md gives the take's room as digital silence only where the take's own reading took its pauses for no sound: a quiet room the loudness asked for levels far down, as `--lufs -23` does a room 78 dB under the take's loudness, is given at that level before, and `check` of what the clean or the fit wrote can read it as digital silence, which VOICE.md's After then gives. On ffmpeg 4.4, check of what clean made of a recording with an edit's mutes between its words, whose room clean read before the first word, can take those mutes for its room and give it as digital silence between the words, as info; its row gives the room clean read beside it. The room tone is read near the quietest moments of a take, so a room that changes level during it, as when an air conditioner cycles, is given at its quieter level, or at its louder one when the pauses of the quieter part are under a twentieth of the take's sound, as in a part about a tenth of it long, and noise learned in one part takes the other down by another amount, which CHECK.md says under how it was measured and VOICE.md wherever noise reduction ran. Under a hum the room is read through a notch on each of its lines, and a loud hum can leave it reading up to about 20 dB over the true room.
211
+ - Where the take's own quiet sits at two levels 6 dB or more apart, a second or more of each, and those of each lie together in time, as a room that steps up or down part way, ramps up, or comes on and goes off once leaves them, `check`, clean and a fit read the pauses of each part against the room there, as recorded and once cleaned, so the louder part's pauses are read as pauses and a line starts and ends at its words. A breath or a held syllable of under a second at the louder level among the quieter part's pauses counts for neither level, and a change of 4 dB or more is read so once cleaned, as the noise reduction can leave it further apart. A soft first or last syllable within a few dB of the louder room reads as that room, as the point on words within about 4 dB of a steady sound says: a real voice under an air conditioner 15 dB under it lost 0.25 s at a line's end. Where what the noise reduction left of the louder part still reads as speech, a fit's split and clean read the take's pauses as recorded, and over any room that changes level clean's `clean.json` says where it kept the words, for `check` of what it made. Clean's Room row gives the take's room in the part the noise was learned in, the quieter one but where the quieter part is short, beside the room `check` of voice.wav reads after, which can be the other part's, and where the room changes level between the first word and the last and the noise reduction ran, that row and the summary say so and when, in seconds of the take: where it gets louder and where it gets quieter, each change of a room that comes on and goes off again, and between which times where the reading cannot tell, as where the room changed under a sentence; and, where the noise was learned in the quieter part, that the louder part came down less, as `clean.json` does (`changesAt`, `changes`, `learnedIn`, and `louder`, that part's room before the cleaning, at the new loudness). So do a fit's VOICE.md, which names the lines laid from the louder part, and its `cues.json`. `check` of the fit's `voice.wav` beside that `cues.json`, and of what clean made beside its `clean.json`, says so beside its room tone where the room it gives is the quieter part's, as the fit's own reading is where the lines hold no pause to read the room in: the louder part, and the lines laid from it, came down less and are not read, and the row warns. Where all of that louder part lay inside pauses clean cut, as an air conditioner that ran only while the reader waited, its pause cut to a second, under a twentieth of a second of it left, `clean.json` says so (`louderCut`), clean's Room tone row and its summary say it lay inside a pause that was cut, or, where `--length` cut the end too, in what was cut (`louderEnd`), and `check` of what it made says the track holds none of it and does not warn. Where those cuts cut into it or moved it, they say how long what stays of it is and where it is in `voice.wav` (`louderLeft`), up to three places, which the take's times do not lead to, none of it in what `--length` cut from the end, and where the room changed in a stretch the reading gives as a range, as under a sentence, at most how long ("up to"); `check` of what clean made, where the room it reads is the quieter part's, warns and points there: where that room came on a quarter of a second after a sentence ended, inside the half second clean keeps of the pause there, 0.24 s of it stayed 23 to 31 dB over the room around it. Where no line of a fit holds a twentieth of a second of it once the fit tightened its pauses, its `cues.json` says so (`louderLines`, empty), as its VOICE.md and `check` of its `voice.wav` do. The other times all of these give are the take's, which a clean's cuts move in what it made. Where no noise reduction ran, as with `--skip denoise`, that row says nothing of it, and a copy of a fit's voice.wav away from its `cues.json`, known by its mark, or of what clean made away from its `clean.json`, cannot tell. The noise reduction, learned in one part, leaves the other at another level, which `check` of what clean made can read as the room, and where the `clean.json` beside it says the room changes level, its fix says the drop it gives is that of the part where the noise was learned.
212
+ - Clean and `check` read the take before the first word and after the last with one room, as a take whose room holds is read, and the reports that say the room changes level go by those two levels between the first word and the last only. So music or another sound there, as an intro or an outro under the voice, stays in what clean made, and so does a louder room there, as an air conditioner still running after the last word; the room between such a sound and the words is a pause, which clean cuts to `--max-pause` and `check` reads as one, and `check` counts that sound as speech, in its voice row too. A steady room within about 10 dB of the voice that comes on only after the last word, as an air conditioner starting after the narration, reads as speech there, so the take's last word is the end of the take: `check` of the take names it as a room that changes level part way, its louder part's level beside it and a pause there that can go unread, clean's VOICE.md and `clean.json` give the time it comes on, and `check` of what clean made names it so where it stays more than a few dB under the voice, else by that `clean.json`. Music there that stands only a few dB over the room, as a soft bed does, reads as the room and is cut with the room there, which VOICE.md's Cuts table gives as the stretch before the first word or after the last, with how far under the voice, and over or under the room tone, its loudest moment sat: on ffmpeg 4.4 an intro 30 dB under the voice's peaks was cut so, its loudest moment 7 dB over the room tone, and on ffmpeg 8 an outro 36 dB under them, 3 dB over it, where the room alone rose 1 dB over it. Clean such a take with `--max-pause 0`, or trim that music off before the clean and put it back after. A fit lays lines by the two levels, so an intro or an outro that reads as the louder part of a room is in no line; one that reads as words, as a soft one near the room can, or one near the voice, can be given a line of its own by a split by pauses, and by the script nothing says so: its row in VOICE.md reads as fitting under the script's first line, for an intro, or its last, for an outro, another line holds two sentences, and is told to be shortened where they do not fit its time, or said to fit where they do, and the captions between them show a neighbouring sentence's words. Trim such a sound off before a fit.
213
+ - Near silence less than 20 dB under the quietest moments between the words, as a recorder can leave before the room comes in or after it stops, is no near silence here, and nor is a quieter room there. Where it holds the take's quietest moments, it is read as the room at its own level, and such a stretch gives the room its level where the room is read in a few short stretches between the words. The noise reduction then goes by that stretch, and the room VOICE.md gives before, in its Room tone row, or for line files the drop its step gives, is that stretch's, not that of the room between the words, which goes unread there. Where every stretch the room was read in lies before the first word or after the last of the speech they count, VOICE.md, a note and `check` say the room tone was read in the quiet stretch before the first word or after the last, and give one way out: where that stretch is a recorder's near silence and not the room, trim it off the take, or off the line files read so, and clean, fit or check again. `check` of a track that a clean, or a fit that cleaned, made, with that run's `clean.json` or `cues.json` beside it and the track as that run wrote it, says so in its room row or its fix where that run said it, and the track holds a voice; of a fit given `--no-clean`, only where the fit's lines hold no pause to read the room in. A video's sound keeps the picture's timeline, so it is trimmed with its picture, or cleaned alone with that stretch trimmed off. They do not say how loud the pauses between the words are, so `check` can pass a room read so while the room between the words is louder: 2.6 s at -84 dBFS before a room at -62 was read as a room at -84, and with those 2.6 s trimmed off, the room was read between the words at -64 dBFS and taken down 5 dB (3 dB on ffmpeg 4.4). `check` of what clean made of such a take reads what that clean kept of that stretch, and where it reads no room there, it says why.
214
+ - Near silence only a little more than 20 dB under the room, before or after a take or a line file with no pause between its words, can keep the room beside it from being read, be read as the room at its own level, or leave the room read as it would be without it, in ways its length does not order: half a second at -84 dBFS before or after a one-sentence line file over a room at -62 kept the room from being read, where 0.3 s before it was read as the room and 0.6 s left the room read as without it. Where the room is not read, no noise reduction runs, and the reports give as the reason that no pause between the words is long enough and the stretches before the first word and after the last were not read as its room. Trim any near silence off the start and end, keep a second of the room before the first word, and clean or fit again.
215
+ - Over a steady sound within about 12 dB of the voice, the reading that finds the room can lose the words after the first second and read the room among them, at that sound's level, and the reports then give that level but not where it was read, nor the trim of that stretch: a real voice under a drone 11 dB under it had its room read in 18 stretches among the 19 stretches of speech `check` counts.
216
+ - A room that changes level more often, as an air conditioner that cycles through a long take or a fan that spins up three times, is read as one room at its quieter level, as music with no rest in it is. Its pauses where it is louder read as speech, and no report names the room for it: `check` passes them, clean keeps them, its VOICE.md giving the longest pause before and after as that of the rest of the take, and a split by pauses can be refused for too few pauses or go by the wrong ones, a line holding several sentences and running over. Listen to such a take, and fit it with the script and its word times, or one file per line.
217
+ - A louder room within about 12 dB of the voice can read as speech all the same, as over any room that near. `check` of the take can pass its pauses there; its room tone row gives that part's level and warns of it, and its longest pause row says a longer pause there can go unread; clean keeps them where the cleaning left the room that near, with a note where it kept one that VOICE.md's longest pause, before and after, is that of the rest of the take; and a split by pauses refused for too few pauses, a note on a split that may be off, and one on any split of a take whose noise reduction was left out, as with `--skip denoise`, say the room changes level and give the word times as the way out. With the noise reduction left out, as with `--skip denoise` or `--no-clean`, a line over such a louder room can start where the room rises, seconds before its words, or run on through it to the take's end, as that note says. That part's level is read in its own quiet stretches held half a second, so where its pauses are each under half a second, as after `clean --max-pause 0.5`, held syllables give it: a real voice under an air conditioner, cleaned so, had its louder part named 7 dB under the voice where its pauses sat 17 dB under it. Where those pauses read 6 dB or more under that level, `check` gives their level beside it and warns by that level, passing where it sits 45 dB or more under the voice, and its longest pause row leaves out that a pause there can go unread, as those pauses are read; where they read as speech too, as they do near the voice, it cannot tell the two apart, and gives the held level as the room's.
218
+ - A hum that comes on part way is found where it stands out in the take's own quiet. Over a room within about 30 dB of the voice it adds only a few dB to that room and can go unfound: a 60 Hz hum at -46 dBFS that came on part way over a room 28 dB under a real voice was called none by `check` and left in by clean, where the same hum through all of the take was found, and on ffmpeg 8 that clean kept the pauses where the hum sounds, the hum standing over the room its noise reduction took down, its VOICE.md giving the longest pause after as that of the rest of the take. The same hum at -40 dBFS was found under the speech and notched on three of its four lines, and on ffmpeg 8 that clean kept those pauses all the same. Notes that land on whole multiples of 50 or 60 Hz, as a music bed tuned that way can have, and a machine's own lines within 1 % of them, as a fan or a motor in the room can have, can read as hum, and `--skip hum` keeps them; clean's and a fit's notes say so where what was notched has no line on 50 or 60 Hz itself, or sits under a room as loud as music under a voice is.
219
+ - With no script, a take is split at its longest pauses. Over a room the noise reduction takes down, 18 to 26 dB under the voice, a sentence's last sound, a breath or a decay a few dB over that room, can stand over what is left and count as speech, so the pause between two sentences reads shorter than one inside a sentence, and a line can start or end inside a sentence even where every line fits. A note says the split may be off where one line holds more than an even share of the speech the lines hold and another under half of one, and a pause left inside a line is as long as, or near, the shortest one the split cut at, within half as long again, and so where one holds most of that speech and another far less than it should, or, with the script, where one holds over twice its share of the script's letters and another under half of its own: over a steady sound within 30 dB of the voice, read in the take's pauses, or over music, which make that likely. A line that then runs over holding more than its share, the lines it pushes, which name every line before them that runs over on its own cue, and the last line cut at the end of the timeline or the lines before those it leaves past it, where such a line holds more than its share, are told to give the script with `--script` before shortening them, or with the script its word times with `--words`, as those keep each line to its own words; so are they where the note on words within about 4 dB of a steady sound left under the take says the split can go by the wrong pauses. A line file laid whole, holding the sound before and after its words, is told to be trimmed to its words before it is shortened.
220
+ - Splitting a take needs a pause between its lines, or word times. Where a line ends is chosen from pauses and text lengths, not from the words, so listen at each line's start; VOICE.md flags a line that starts at a gap between words.
221
+ - The captions' timing comes from the script and the pauses, or the word times `--words` gives, not from recognizing the words, and word times in `phrases.json` are estimates. Read them once against the sound.
222
+ - A line's words never start before its cue, and it plays at most 25 % faster: it is laid by the reading it was cut from the take by, 0.08 s of what comes before its first word kept ahead of its start. A line too long for its room runs over and moves the lines after it; shortening it or giving its step more time is up to you. A last line that runs past the end of the video is cut there, its captions and `phrases.json` end there too, and the summary and VOICE.md say by how much. A line pushed to start after the end is not heard at all, and the summary, VOICE.md and `cues.json` name it.
223
+ - `clean --length` cuts off what still does not fit once the pauses are a quarter of a second, or with every pause kept where the voice rises under 12 dB over a steady sound under it, and the tempo is up to `--max-speed`, and warns how much is lost.
224
+ - Fillers are cut only from a words file that keeps them, and only from an English take: um, umm, uhm, uh, uhh, erm, er, hmm, hm, mm and mmm. When the words file names its language it has to be English, and when it names none (or gives as its language what reads as no language's name or code) its words have to read as English, since um and er are words in German and Portuguese, and er in Danish and Norwegian. The test that refuses another take's words is no proof that a words file is this take's: it lets them through where they cover half or more of this take's speech and no more than half of the time of their pauses of half a second or more falls where this take speaks, or those pauses add up to under a second, or this take itself pauses for less than half as long between its first word and its last, and their fillers are then cut where they say. Of 80 placings of the words of pieces of one real narration over two other real takes, 9 got through so, their pauses falling 34 to 50 % on the take's speech. It refuses a take's own words where a sound sits in most of those pauses: a filler the speech-to-text model left out of the words file, as many do, as an "um" of 0.45 s in each pause of 0.8 s did, or a breath that fills most of each pause, joined to the words on either side, as breaths of 0.4 to 0.5 s, 20 to 26 dB under the voice's peak, in gaps of 0.55 to 0.65 s do. The refusal says so: clean such a take without `--words`, which cuts no filler. A fit takes a words file as given: another take's word times split this take where they say, and a line can lose the end of its last word or the start of its first, with no note, so give the word times of this take.
225
+ - `fit` places up to 30 minutes of voice on up to 30 minutes of video. It holds the voice in memory, once, and reads the video's own sound and the mix in chunks: a 10 minute take of 40 lines took about two minutes and 0.7 GB here on a 30 minute video with its own sound under the voice, and 29 minutes of voice on that video, every line too long for its room, two to two and a half minutes and 1.4 GB. Splitting the take by `--words` adds about 35 MB for a 30 minute script of 4,500 words, and about 95 MB for 9,000 (a fast reader, or a words file that times each character of Chinese or Japanese). Only the words that start inside the take are read, so the words file of a session the take was cut from, from its start, works; before any work, a words file with none of the script's words inside the take is refused, and so is a script, or a words file inside the take, with more words than the take can hold at 8 a second, or with more than 100 million pairs of words between the two. `clean` and `check` read in chunks and take recordings of any length; past two minutes, clean writes each step of a take to its work folder and removes it once the next one is written, so a long clean needs about 1.8 GB of free disk for each hour of the take while it works.
226
+ - Only a file's first sound stream is read, and `clean.mp4` and `mix.mp4` hold the picture and one track of sound: other sound streams (the mic and system tracks of a screen recorder, say) and subtitles are not carried over. The summary and VOICE.md say so when a file has more than one sound stream, or subtitles. Chapters are carried over, since both keep the video's timeline, except from a still picture whose clean cut its pauses or raised its tempo: their times would no longer hold, so they are left out of `clean.mp4`, and the summary and VOICE.md say so.
227
+ - A take or a line file of two channels laid out in a way ffmpeg will not mix down, as a surround stem exported on its own whose channels are SL and SR, or BL and BR, with no front channel, is refused once its sound is read, saying so, with exit code 2, but for a video of more than one picture, whose sound is read on the video's timeline; the dry run, which reads no sound, does not tell. Give it as mono, or as stereo with its channels as left and right. Music given with `--music` whose channels ffmpeg will not mix down, two with no front channel, as SL and SR or BL and BR, or more with none, as four laid out as BL, BR, SL and SR, is not refused: musicfit, which fits it, stops on it in ffmpeg's words, and the fit ends with exit code 1, so give the music as stereo with its channels as left and right. Nor is music whose samples are not all numbers (NaN or infinite), as a float WAV a plug-in that failed can write: musicfit can stop on it with exit code 1, saying there is "No way to fit this track to that length with these settings" though the track is at fault, or fit it, those samples in the part of the track it uses then clicks in `music/fitted.wav`, `music/mix.wav` and `mix.wav` that neither VOICE.md nor musicfit's FIT.md names. `voiceoverfit check` of the track refuses such a file, with exit code 2, and says where the first of them is; it reads any other track as a voice, so its rows and fixes are a voice's, and none of them is for music: a clean of it cuts its bass under 80 Hz, and can cut its rests as pauses and its end as the room after the last word. A take, a line file or a track `check` reads, of more than two channels in a layout voiceoverfit has no mixdown for, as a 5.1 in the order a MOV can keep it or 5.1.2(back), has all of its channels averaged, an LFE among them, as a file with no layout has, so `check` gives the loudness of that average and not of the file as a player mixes it down: give such a file as stereo, or as a 5.1 in ffmpeg's own order (FL, FR, FC, LFE, BL, BR). A video's own sound under a fit goes from one ffmpeg to the next on the video's timeline in Matroska, which keeps no layout, so a fit mixes one of more than two channels down to two by the layout ffprobe gives the video, as `check` reads it, with the headroom that mixdown leaves set by the peaks of its channels as far as the fit reads that sound, 10 s past the picture's end, where `check` reads them all, and all of its channels averaged where that layout is one voiceoverfit has no mixdown for, as above, and mixes one of two channels as left and right, whatever their layout: a video whose two channels are laid out as LFE and FC, or as FC and LFE, in a MOV has its LFE on one side of the mix, and VOICE.md gives the loudness of that sound as read that way, where `check` leaves the LFE out. Give such a video's sound as stereo with its channels as left and right, or use `--video-sound drop`. ffmpeg 4.4 has no order of channels of a file's own: it takes the channels of a MOV laid out in an order of its own as if they were in its own order for the layout it reads. It reads a file of two channels laid out as LFE and FC as FC and LFE, so in a take of sound alone so laid out it takes the file's FC for the LFE and leaves it out, and `check` hears only what its LFE holds: one whose voice is in its FC alone is called silent by `check` and refused by clean and a fit as holding no voice, and `check` measures the loudness of a video's sound so laid out that way too. It reads two laid out as FC and LFE2 as having no layout, so its LFE2 counts as a front channel there, and a 5.1 in film order as FL, FR, FC, LFE, BL, BR, its centre taken for the right channel, its BL for the LFE and left out, and its LFE for the BR, so `check`, clean and a fit there can say that only the right channel carries the voice, and use that channel alone. Give such a file as mono, as stereo with its channels as left and right, or as a 5.1 in ffmpeg's own order, or check, clean or fit it on ffmpeg 8 or 9, which read those layouts in the file's own order, as above. A file whose sound changes its number of channels part way, as two recordings joined end to end or a capture that switches from stereo to 5.1 can, has its loudness and true peak measured as ffmpeg brings it to the channels it starts with; where ffprobe gives it more than two channels and its sound starts on another number of them, the clipping read on each of its channels can be missed or named on the wrong one.
228
+ - A video whose own sound already holds a narration, as one exported from an editor with an earlier fit's mix in it, keeps neither that fit's `cues.json` nor its mark, and is taken as any video: that narration is ducked under the new lines, and heard at its own level where they end sooner, with no note. Give the video without it, or `--video-sound drop`.
229
+ - CHECK.md of a fit's `mix.wav` over the video's own sound gives launch-film's check of the fit's `mix.mp4` beside it with the `--allow` stretches the fit's VOICE.md gives where that `mix.wav` is as the fit wrote it, and does not read `mix.mp4` to tell whether it was trimmed or edited since, which would take those stretches off its timeline. CHECK.md of a copy of a fit's `mix.mp4` over the video's own sound away from that fit's `cues.json`, known by its mark alone, gives those stretches as the fit's times, which hold only while the copy is as the fit wrote it: its mark cannot tell whether it was trimmed since.
230
+ - A copy of a fit's `voice.wav` or `mix.mp4` away from that fit's `cues.json` is known by the mark voiceoverfit wrote in it alone, which an edit keeps and which says nothing of what the file held: `check` of such a copy of the `voice.wav`, or of a `mix.wav` or `mix.mp4` of the voice alone, trimmed since, reads it as on the fit's timeline, by the line times its mark gives, so the silence the fit laid between its lines can fall inside a line and be given as info, digital silence between the words, even where the room as the fit wrote it fails, and a fit given such a copy of that `voice.wav`, edited since, with such a copy of the `mix.mp4` takes it as that fit's own voice, leaves the mix's sound out and says the mix holds this voice. Beside that `cues.json`, the size and hash it keeps of each file the fit wrote tell such an edit.
231
+ - A fit's track read as a take, as one changed since the fit wrote it is, or as a fit given an earlier fit's `voice.wav` reads its voice, takes the digital silence the fit laid between its lines for its room where those lines hold too few pauses of their own, and so can the reading of a later fit's lines that each hold two of an earlier fit's lines and the silence between them, and of line files that are earlier fits' tracks. No report passes that silence as a room, `check` giving it as info and VOICE.md as digital silence, but the take's own room goes unread, a room of text to speech's own digital silence too. The reports of such a track beside that fit's `cues.json`, and of what a clean made of one beside its `clean.json`, say that the silence between its lines is a fit's and can be taken for the room, where that fit read the room of its take, or of such a line file, as that silence and the earlier fit laid more than one line, as a report voiceoverfit wrote that still vouches for the track by its size and hash gives them, and otherwise no more than that the take or the line file holds that fit's lines, as for a track trimmed or edited since its fit, which can hold fewer lines than its mark or report lists, or a copy known by the mark alone, and where its only pauses are digital silence, that it holds them and its only pauses are digital silence, so its room is not known; the VOICE.md of a fit of such line files, and of a clean of its track, says no more of their room than that; where such a line file's own lines hold a room, they say nothing of whose the silence between those lines is, and `check` of the later fit's track can give it as digital silence between the words, or, as on ffmpeg 4.4, read the room those lines hold. A copy of such a fit's `voice.wav`, or of its mix of the voice alone, away from that `cues.json` is known by the fit's mark alone, which does not say that its lines hold earlier fits' silence; what a clean cut in time made of a fit's track carries no mark, so a copy of it away from its `clean.json` cannot be told from a take, and nor can a fit's track with neither its `cues.json` beside it nor its mark, as an editor that drops the comment tag writes it. `check` of them gives that silence as info, digital silence between the words, and a clean of them as digital silence, and neither can say whose it is, whatever room the lines hold.
232
+ - A take whose pauses hold a DC offset and nothing else, as some text to speech leaves them, reads as silent between its words above 80 Hz in `check` and clean. Clean's high-pass takes the offset out and its processing leaves those pauses near -93 dBFS, where `check` of what it made reads no room, and so do that clean's VOICE.md after, a clean of that and a fit of it, and where a pause of 0.25 s or more lies between the words they say no more than that its room tone is not measured; `check` of a fit of it whose line holds such a pause gives that pause as digital silence between the words, and a clean of that fit's track, which runs those pauses through the filters a second time, can leave them reading as a very quiet room, which `check` of what it made passes and that clean's VOICE.md gives after.
233
+ - A take, or line files, that a noise gate left silent between their words keep their room under the words, where no report hears it: those pauses read as digital silence, and neither clean nor a fit takes any of that room out. A hum under such words, with under 4 s of speech in each, can go unfound by `check`, a fit or a clean; the note of a clean, or of a fit that cleans, not given `--skip hum`, then says no hum was looked for in the take, or names the line files, and a fit given `--no-clean`, or a run given `--skip hum`, gives no such note. One a fit or clean does not find stays in what it makes, and `check` of a track that holds 4 s or more of that speech can find it. A line file whose silence around its words the reading takes for a model's is left out of a search over line files together and given no hum another file's search found, so a hum found in the others is not notched out of it, and one it holds stays in its line: the fit's note says so, and `check` of the fit's track beside that fit's `cues.json` gives the hum as not measured, or the level it hears, naming that file, and where it hears one, a fix that says the fit notched no hum out of it. A copy of the track away from that `cues.json` is known by the mark alone, which does not say so, and its check can give the hum as none.
234
+ - Line files recorded on two mains, one hummed at 50 Hz and another at 60 Hz, have each hum notched out of the files whose own search found it, and the reports name both hums, but a line file too short to look in alone is given the hum of the first line file whose own search found one, else the one found over the short files together, which can be the other mains': its own hum then stays in its line, and `check` of the fit's track can miss it. Where the line files' hums sit on both mains, VOICE.md names the files each was notched out of, and a note names each such short file and whose hum it was given; where every hum found is on one mains, nothing names a short file whose own hum is on the other. Listen to such lines.
235
+ - A take that holds two hums, one on 50 Hz and another on 60 Hz, has at most one of them notched out: where `check` of voice.wav hears the other after, the summary and VOICE.md give it with its base.
236
+ - voiceoverfit tells a file missing, unreadable, damaged or refused, and where a video's sound starts and how loud a file is, by what ffmpeg and ffprobe write of their own: their own lines, with the names voiceoverfit gave them taken out, from calls that list none of the file's tags, the loudness meter's from a pipe that carries none of them, and the list of a video's first sound frame that ffmpeg writes on its output, which holds no name or tag. A name or a tag that holds their words is not read as theirs; words a file itself could make them write inside one of their own lines would be.
237
+ - A file ffmpeg decodes only in part, as a download cut short or a file damaged part way, is read as the part that decodes, with no word of the rest: `check` and clean give that part's length and a fit splits that part into its lines, and a clean or a fit over such a video lays its sound on the length the video states, as above: `clean.mp4`'s and `mix.mp4`'s picture ends where the part of the video that decodes does, `clean.mp4`'s sound is silent from there to that length, and where the last line ends before the video does, the last of the `--allow` stretches VOICE.md gives runs to that length, so launch-film's check with them passes the end where the picture stops. Where a stretch the run reads lies in the damage, ffmpeg can stop on it, as ffmpeg 9 and 4.4 stop on an M4A damaged in its middle, and the file is then refused as damaged, with exit code 1. Give the whole file. A video whose sound's packets carry times far past its length, as a damaged AVI's can, is read on its timeline with silence filling each jump in those times: `check` then gives a length far past the video's and can call it silent, clean can refuse it as holding no voice or clean it on that timeline, into a `voice.wav` as long as those times, mostly that silence, and a `clean.mp4` whose sound is silent from the first jump on, a fit given it as the voice reads it on that timeline too, and can refuse it as holding no voice, or as longer than the 30 minutes it places, and ffmpeg holds that silence in memory while it reads, so where the memory runs out the run can end saying ffmpeg was stopped by SIGKILL, and where ffmpeg cannot get that memory, as under a limit on the memory it may take, it fills only part of a jump and goes on with none of the sound after it, so `voice.wav` ends inside that jump, without that sound, as the clean's notes then say. A fit given it with `--video` reads its sound no further than 10 s past its picture's end and mixes it only as far as the picture goes, so none of that sound past the first such jump goes into the mix. Give the video made again, or its sound taken out of it as a file of its own.
238
+ - A video whose sound runs on more than 5 s past its picture's end can be refused by `check` and clean, and by a fit given it as the voice, with exit code 1, saying that ffmpeg read a stretch of its sound "without an error, but gave no sound for it", where that stretch lies past the picture's end: a stretch more than 5 s into a file can be read with a seek to 5 s before it, and a seek into a video goes by its picture, so one near or past the picture's end, as in an MPEG-TS or an FLV, can land past the stretch. The refusal gives the way out: its sound taken out of it as a file of its own is read whole, so check that, give it to a fit as the voice, and clean it with `--max-pause 0`, which keeps its length and its pauses, so its `voice.wav` lines up with the video's sound, though no `clean.mp4` comes of it. A fit given such a video with `--video` is made. A stretch whose seek would start before the picture is read from the file's start, with no seek, so a sound that starts before its picture is read whole where that picture is not missed as below, and so is `check` of a fit's `mix.mp4` over such a video or of a clean's `clean.mp4` of one, which keeps the picture in its place after that sound.
239
+ - ffprobe and ffmpeg learn a file's streams from the part of it they read first, which voiceoverfit sets to 100 s or 100 MB of the file, whichever comes first, in every call it makes, a read of a stretch with a seek among them, and which is also how far ffprobe reads to time a sound's packets; musicfit, which reads the music of a fit with `--music` by calls of its own, keeps ffmpeg's own, 5 s (7 s in an MPEG-TS or an MPEG-PS, 90 s in an FLV) and 5 MB. So a stream that starts later than 100 s after another, or past the file's first 100 MB, can be missed, as one can in an MPEG-TS, an MPEG-PS, an FLV or a Matroska file: a sound 30 s after a picture at 30 Mb/s starts past those 100 MB. A picture so missed is taken to start with the sound, an MPEG-TS's with no size and at 90000 frames a second, and the reports say what holds of the video so taken, as VOICE.md that the voice starts at its first frame and the summary that its picture was encoded again since an MP4 cannot carry it as it was; `clean.mp4` and `mix.mp4` can then put the picture out of its place or keep only part of it, and on ffmpeg 4.4 writing them can take many minutes, or hours, as it fills the time before the picture, 100 s or more, with its first frame at 90000 frames a second. In an FLV such a picture can be missed altogether, as a Sorenson Spark (`flv1`) one is, and the file is then read as a sound alone: clean cuts its pauses and writes no `clean.mp4`, and a fit given it with `--video`, or whose cues file names it, refuses it, saying ffprobe finds no moving picture in it. Clean it with `--max-pause 0`, which keeps its length and its pauses, so its `voice.wav` lines up with the video's sound, and give a fit a video whose picture starts sooner after its sound. In a Matroska or WebM file, a read of the sound before a picture so missed can land on that picture, so `check`, clean and a fit given such a video as the voice can be refused as above, with the same way out. A sound so missed has no channels and no rate as ffprobe gives it, or, for AAC in an FLV, stereo at 44100 Hz, as the FLV's header states, whatever its own, which `check`'s channels row says, and can be read as full of gaps or as no voice: `check` then leaves those gaps out of the speech it counts, as where the file has no sound, and a clean's note says the file holds no sound there and `voice.wav` has silence there, though both hold that sound; its room and hum can go unmeasured, a clean's level before 3 dB apart from `check`'s, and a fit of it as the voice refused, or made of only part of its speech, with nothing in the result to say so. In an MPEG-PS or an FLV ffprobe can miss such a sound altogether: `check`, clean and a fit given such a video as the voice, or a fit given it with `--music`, can refuse it, saying ffprobe finds no sound in it, and a fit over it with `--video` can lay the voice alone, VOICE.md saying ffprobe finds no sound in that video. Give its sound taken out of it as a file of its own, as above, for a sound so missed decoded with ffmpeg naming its stream (`-map 0:a:0`), as ffmpeg leaves out a stream it has not learned, and for one ffprobe misses altogether, with `-analyzeduration` and `-probesize` set past where it starts, before `-i`.
240
+ - Each report says what its run read in the file it describes, or what a report or mark voiceoverfit wrote and still vouches for says of it, and no more, so it can say less than the file holds: of a track trimmed, leveled or edited after the kit wrote it, of a room the loudness asked for levels far down, and of line files read together, and VOICE.md's longest pause after is the longest the clean's cuts left of the pauses it read in the take, which `check` of voice.wav reads again and can give at another length. `check` of the file itself is what to go by.
241
+ - A file a run writes that is over 8 GiB, as a clean's `voice.wav` of a take of more than about eight hours is, keeps in that run's report its size and a hash of its first and last 64 MiB rather than of all of it, so an edit inside its middle at the same size goes unseen: a later run into its folder replaces it, and `check` reads it by that report.
242
+ - It does not check whose voice a take is or whether you may use it.
243
+
244
+ ## See also
245
+
246
+ - [easyscreenshotkit](https://github.com/MakersMCP/easyscreenshotkit) records a demo video of a site and writes the steps.json voiceoverfit places lines on.
247
+ - [launch-film](https://github.com/MakersMCP/launch-film) turns a site into a short launch film, and checks a finished video.
248
+ - [musicfit](https://github.com/MakersMCP/musicfit) fits a music track to a video cut and ducks it under the voice.
249
+
250
+ ## License
251
+
252
+ MIT
package/package.json CHANGED
@@ -1,6 +1,50 @@
1
1
  {
2
2
  "name": "voiceoverfit",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Fit a voice to a video: clean and level a recording or a text-to-speech take, place each line on its step or scene so it ends before the next one, and write captions from the script.",
5
+ "license": "MIT",
6
+ "author": "Emin Budak",
7
+ "homepage": "https://github.com/MakersMCP/voiceoverfit#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/MakersMCP/voiceoverfit.git"
11
+ },
12
+ "bugs": "https://github.com/MakersMCP/voiceoverfit/issues",
13
+ "bin": {
14
+ "voiceoverfit": "skills/voiceoverfit/scripts/voiceoverfit.js"
15
+ },
16
+ "main": "skills/voiceoverfit/scripts/lib/voice-fit.js",
17
+ "files": [
18
+ "skills",
19
+ "README.md",
20
+ "LICENSE"
21
+ ],
22
+ "engines": {
23
+ "node": ">=22"
24
+ },
25
+ "scripts": {
26
+ "test": "node --test \"test/*.test.js\""
27
+ },
28
+ "keywords": [
29
+ "voiceover",
30
+ "voice",
31
+ "narration",
32
+ "audio",
33
+ "video",
34
+ "captions",
35
+ "subtitles",
36
+ "srt",
37
+ "vtt",
38
+ "loudness",
39
+ "noise-reduction",
40
+ "text-to-speech",
41
+ "ffmpeg",
42
+ "agent-skills",
43
+ "claude-code",
44
+ "codex",
45
+ "cursor"
46
+ ],
47
+ "dependencies": {
48
+ "musicfit": "^0.2.0"
49
+ }
50
+ }