Add js bindings for intermediateDecodeExpensive()
And intermediateDecodeExpensiveWithMetadata().
This commit is contained in:
parent
ed656aa487
commit
4eeea467ef
@ -106,6 +106,26 @@ class StreamImpl {
|
||||
return binding.IntermediateDecodeWithMetadata(this._impl, aNumResults);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute the intermediate decoding of an ongoing streaming inference, flushing buffers first. This ensures that all audio that has been streamed so far is included in the result, but is more expensive than intermediateDecode() because buffers are processed through the acoustic model.
|
||||
*
|
||||
* @return The STT intermediate result.
|
||||
*/
|
||||
intermediateDecodeExpensive(): string {
|
||||
return binding.IntermediateDecodeExpensive(this._impl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute the intermediate decoding of an ongoing streaming inference, flushing buffers first. This ensures that all audio that has been streamed so far is included in the result, but is more expensive than intermediateDecodeWithMetadata() because buffers are processed through the acoustic model. Return results including metadata.
|
||||
*
|
||||
* @param aNumResults Maximum number of candidate transcripts to return. Returned list might be smaller than this. Default value is 1 if not specified.
|
||||
*
|
||||
* @return :js:func:`Metadata` object containing multiple candidate transcripts. Each transcript has per-token metadata including timing information. The user is responsible for freeing Metadata by calling :js:func:`FreeMetadata`. Returns undefined on error.
|
||||
*/
|
||||
intermediateDecodeExpensiveWithMetadata(aNumResults: number = 1): Metadata {
|
||||
return binding.IntermediateDecodeExpensiveWithMetadata(this._impl, aNumResults);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute the final decoding of an ongoing streaming inference and return the result. Signals the end of an ongoing streaming inference.
|
||||
*
|
||||
|
@ -35,6 +35,7 @@ using namespace node;
|
||||
|
||||
%newobject STT_SpeechToText;
|
||||
%newobject STT_IntermediateDecode;
|
||||
%newobject STT_IntermediateDecodeExpensive;
|
||||
%newobject STT_FinishStream;
|
||||
%newobject STT_Version;
|
||||
%newobject STT_ErrorCodeToErrorMessage;
|
||||
|
Loading…
Reference in New Issue
Block a user