Skip to content

Commit e3ff8db

Browse files
committed
feat(speech-to-text): endOfPhraseSilenceTime and splitTranscriptAtPhraseEnd params added to recognize, createJob, and recognizeUsingWebSocket methods
* new constants added to `ModelId` enum * optional property `end_of_utterance` added to model `SpeechRecognitionResult`
1 parent 964e9e1 commit e3ff8db

3 files changed

Lines changed: 298 additions & 182 deletions

File tree

lib/recognize-stream.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ class RecognizeStream extends Duplex {
101101
* @param {boolean} [options.processingMetrics] - If true, requests processing metrics about the service's transcription of the input audio (default=false)
102102
* @param {number} [options.processingMetricsInterval] - Specifies the interval in seconds at which the service is to return processing metrics
103103
* @param {boolean} [options.audioMetrics] - If true, requests detailed information about the signal characteristics of the input audio (detailed=false)
104+
* @param {number} [options.endOfPhraseSilenceTime] - If `true`, specifies the duration of the pause interval at which the service splits a transcript into multiple final results
105+
* @param {boolean} [options.splitTranscriptAtPhraseEnd] - If `true`, directs the service to split the transcript into multiple final results based on semantic features of the input
104106
* @constructor
105107
*/
106108
constructor(options: RecognizeStream.Options) {
@@ -173,6 +175,8 @@ class RecognizeStream extends Duplex {
173175
'speaker_labels',
174176
'grammar_name',
175177
'redaction',
178+
'end_of_phrase_silence_time',
179+
'split_transcript_at_phrase_end',
176180
];
177181
const openingMessage = processUserParameters(options, openingMessageParamsAllowed);
178182
openingMessage.action = 'start';

0 commit comments

Comments
 (0)