@makefully/dutifully 1.12.0 → 1.12.1
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.
- package/CHANGELOG.md +4 -0
- package/README.md +8 -0
- package/package.json +1 -1
- package/src/classes/Transcript.js +5 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -205,6 +205,14 @@ If your scripts include any phrases that should remain unbroken by the captionin
|
|
|
205
205
|
|
|
206
206
|
Script lines may include an optional `class` (for example `"title"` or `"stage"`). In VTT exports this becomes a cue class span (`<c.title>…</c>`). In SAMI/SMI the paragraph `Class` is the job language plus `CC` (for example `ENUSCC` for `en-US`); when a speaker and/or script `class` is present, the dialog is wrapped in `<SPAN Class="…">` (for example `Class="todd stage"`). In JSON exports it is included on each caption entry. SRT, LRC, and MP3 SYLT ignore it.
|
|
207
207
|
|
|
208
|
+
Script lines may also include an optional `events` array for one-shot timed markers. Entries may be:
|
|
209
|
+
|
|
210
|
+
* a **number** — add to the running absolute time offset (ms)
|
|
211
|
+
* a **string** `"<phrase"` / `">phrase"` — set the offset to just before/after that phrase in the caption; any other string fires that event at the current offset
|
|
212
|
+
* an **object** `{ "event", "time"?, "before"?, "after"? }` — fires `event`; optional fields set the absolute offset (`time` wins over `before` over `after`)
|
|
213
|
+
|
|
214
|
+
Cheerfully resolves these against caption timings and exports them in parallel using the same caption `format` (`events.json`, `{id}.events.vtt` / `.srt` / `.sami` / `.smi` / `.lrc`, or a separate MP3 SYLT frame with content type `EVENTS` labeled `"events"`).
|
|
215
|
+
|
|
208
216
|
## Example
|
|
209
217
|
|
|
210
218
|
Find an example script in the `./examples/` folder. You can run either `npm run test-elevenlabs` or `npm run test-polly` to create VO tracks in the examples folder that you can then use to try out `npm run test-rhubarb` and `npm run test-transcription`.
|
package/package.json
CHANGED
|
@@ -41,7 +41,7 @@ const
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
const
|
|
44
|
-
{caption, class: lineClass, speaker, voice} = line,
|
|
44
|
+
{caption, class: lineClass, speaker, voice, events} = line,
|
|
45
45
|
resolvedVoice = voice ?? (voiceOrVoiceMap ? resolveVoice(voiceOrVoiceMap, speaker) : null),
|
|
46
46
|
result = {caption};
|
|
47
47
|
|
|
@@ -53,6 +53,10 @@ const
|
|
|
53
53
|
result.speaker = speaker;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
if (events) {
|
|
57
|
+
result.events = events;
|
|
58
|
+
}
|
|
59
|
+
|
|
56
60
|
if (resolvedVoice) {
|
|
57
61
|
result.voice = resolvedVoice;
|
|
58
62
|
}
|