Class: SpeakerStream

SpeakerStream

new SpeakerStream(options)

Object-Mode stream that splits up results by speaker.

Output format is similar to existing results formats, but with an extra speaker field,

Output results array will usually contain multiple results. All results are interim until the final batch; the text will not change, but the speaker may, and so the text may move from one interim result to another.

Note: when combined with a TimingStream, data events may contain a combination of final and interim results (with the last one sometimes being interim)

Ignores interim results from the service.

Parameters:
Name Type Description
options Object
Source:

Methods

handleResults(data)

Captures the timestamps out of results or errors if timestamps are missing

Parameters:
Name Type Description
data Object
Source:

Events

data

Emit an object similar to the normal results object, only with multiple entries in the results Array (a new one each time the speaker changes), and with a speaker field on the results.

result_index is always 0 because the results always includes the entire conversation so far.

Parameters:
Name Type Description
results-format Object

message with multiple results and an extra speaker field on each result

Source: