StreamSubtitlesInputNode class

see:

Signature:

export declare class StreamSubtitlesInputNode extends SourceMediaNode

Extends: SourceMediaNode

Methods

Method Modifiers Description

nudge(nudge)

Applies a nudge to the outgoing stream timestamps by the specified number of milliseconds. Unlike audio/video inputs this nudge is not gradual but abrupt, as the input is not continuous

sendChunk(chunk)

Send a WebVTT subtitle cue (or multiple cues) given as a WebVTT document, i.e. containing "WEBVTT" and time ranges/cue text. Timestamps are relative to real time, according to the first timestamp sent. It is recommended to send an empty message on initialisation to anchor these timestamps.

sendCue(cue)

Send a WebVTT-style subtitle cue given the body text and the time range of the cue. The timestamp is a Norsk internal timestamp, which may be observed (and perhaps offset calculated) from some other node, such as a stream timestamp report node.

sendFragments(message)

Send timed text fragments (ideally timed words) which can later be split and formatted into subtitle cues

Timestamps are required for each fragment, which should of course be ordered, and the start/end of the run of fragments. The presence of the overall start/end time allows signalling of a gap with no speech so as not to hold up accumulated cues/other streams downstream. It is advisable to send an empty message initially when the appropriate timestamp is known.