new TimingStream(opts)
Slows results down to no faster than real time.
Useful when running recognizeBlob because the text can otherwise appear before the words are spoken
Parameters:
| Name | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
Object |
Properties
|
- Source:
Methods
getCurrentResult(results, cutoff) → {*}
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 |
||
cutoff |
- Source:
Returns:
- Type
- *
handleResult(result)
Creates a new result with all transcriptions formatted
Parameters:
| Name | Type | Description |
|---|---|---|
result |
- Source:
scheduleNextTick(cutoff)
Schedules next tick if possible.
triggers the 'close' and 'end' events if the buffer is empty and no further results are expected
Parameters:
| Name | Type | Description |
|---|---|---|
cutoff |
- Source:
tick()
Tick emits any buffered words that have a timestamp before the current time, then calls scheduleNextTick()
- Source: