Skip to main content

Interface: VoiceoverTracker

Defined in: src/audio/Voiceover.ts:50

Tracks one narration segment: lets a callback wait for a bookmark or for the whole narration to finish. One tracker is created per voiceover call.

Properties​

bookmarks​

readonly bookmarks: readonly Bookmark[]

Defined in: src/audio/Voiceover.ts:54

Every bookmark found in the transcript, in order.


error​

readonly error: string

Defined in: src/audio/Voiceover.ts:58

The failure message if the narration errored, else null.


finished​

readonly finished: Promise<void>

Defined in: src/audio/Voiceover.ts:56

Resolves when the narration finishes (or fails, or is cancelled).


text​

readonly text: string

Defined in: src/audio/Voiceover.ts:52

The spoken text, with bookmark markers already removed.

Methods​

markReached()​

markReached(mark): boolean

Defined in: src/audio/Voiceover.ts:68

Whether the narration has already reached mark.

Parameters​

mark​

string

Returns​

boolean


waitForFinish()​

waitForFinish(): Promise<void>

Defined in: src/audio/Voiceover.ts:66

Resolve when the narration finishes. Same promise as finished.

Returns​

Promise<void>


waitForMark()​

waitForMark(mark): Promise<void>

Defined in: src/audio/Voiceover.ts:64

Resolve when the narration reaches mark. Resolves immediately if the mark was already reached, and resolves on finish if the mark never arrives (so an animation beat never hangs).

Parameters​

mark​

string

Returns​

Promise<void>