Class: TimingStream

TimingStream

new TimingStream(opts)

Applies some basic formating to transcriptions: - Capitalize the first word of each sentence - Add a period to the end - Fix any "cruft" in the transcription - etc.
Parameters:
Name Type Description
opts
Properties
Name Type Attributes Default Description
model some models / languages need special handling
hesitation <optional>
'\u2026' what to put down for a "hesitation" event, defaults to an ellipsis (...)
Source:

Methods

getCurrentResult(results) → {*}

Returns one of: - undefined if the next result is completely later than the current cutoff - a cropped clone of the next result if it's later than the current cutoff - the original next result object (removing it from the array) if it's completely earlier than the current cutoff
Parameters:
Name Type Description
results
Source:
Returns:
Type
*

getNextWordOffset(lastResultWasFinal, numCurrentTimestamps) → {*}

try to figure out when we'll emit the next word
Parameters:
Name Type Description
lastResultWasFinal
numCurrentTimestamps
Source:
Returns:
Type
*

handleResult(result)

Creates a new result with all transcriptions formatted
Parameters:
Name Type Description
result
Source:

tick()

Tick occurs every half second, or when results are received if we're behind schedule.
Source: