You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: speech-to-text/speaker-stream.js
+29-17Lines changed: 29 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -36,10 +36,12 @@ var noTimestamps = require('./no-timestamps');
36
36
*
37
37
* @constructor
38
38
* @param {Object} options
39
+
* @param {boolean} [options.speakerlessInterim=false] - emit interim results before initial speaker has been identified (allows UI to update more quickly)
39
40
*/
40
41
functionSpeakerStream(options){
41
42
options=options||{};
42
43
options.objectMode=true;
44
+
this.options=options;
43
45
Transform.call(this,options);
44
46
/**
45
47
* timestamps is a 2-d array.
@@ -80,7 +82,6 @@ function SpeakerStream(options) {
80
82
* @private
81
83
*/
82
84
this.speaker_labels=[];
83
-
84
85
}
85
86
util.inherits(SpeakerStream,Transform);
86
87
@@ -96,8 +97,11 @@ var TO = 2;
96
97
97
98
SpeakerStream.ERROR_MISMATCH='MISMATCH';
98
99
99
-
100
-
SpeakerStream.prototype.process=function(){
100
+
/**
101
+
* Builds a results object with everything we've got so far
msg='No speaker_labels found. SpeakerStream requires speaker_labels to be enabled.';
243
254
}else{
244
-
msg='Mismatch between number of word timestamps ('+this.timestamps.length+') and number of speaker_labels ('+this.speaker_labels.length+') - some data may be lost.';
255
+
msg='Mismatch between number of word timestamps ('+this.timestamps.length+') and number of speaker_labels ('+
256
+
this.speaker_labels.length+') - some data may be lost.';
0 commit comments