ass_karaoke_retime
Retime karaoke syllables to a new time span, keeping relative lengths or making them even, and report each syllable's before and after durations.
Instructions
Retime existing karaoke to a new span, reporting each syllable before/after.
Arguments
selection lines to retime (None uses the session selection).
mode "proportional" keeps the existing relative syllable lengths,
"even" gives every syllable the same duration.
new_start_ms / new_end_ms
new span. When given, the line's own Start/End are set
to them as well (that is what "retime the line" means); when
both are omitted the line's current span is used, optionally
moved by shift_ms or stretched by factor.
shift_ms move the whole span by this many ms (no length change).
factor scale the span length about the line start.
min_cs minimum syllable duration; an impossible span raises
:class:ToolError.
dry_run compute and report without writing anything.
Returns
{"doc_id", "mode", "dry_run", "lines": [{"index", "old_text", "text", "old_start_ms", "old_end_ms", "start_ms", "end_ms", "span_cs", "times_changed", "syllables": [{"index", "text", "kind", "before_cs", "after_cs", "before_ms", "after_ms", "delta_cs"}], "duration_sum_cs", "line_duration_cs", "discrepancy_cs", "matches_line_duration", "message"}], "lines_changed": n, "reported_not_stretched": True}
The new centisecond durations sum to the new span exactly; any mismatch against the line duration is reported rather than stretched.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | proportional | |
| doc_id | No | ||
| factor | No | ||
| min_cs | No | ||
| dry_run | No | ||
| shift_ms | No | ||
| selection | Yes | ||
| new_end_ms | No | ||
| new_start_ms | No |