Azure-Samples/SpeechToText-WebSockets-Javascript

Feature Request: Need ability to specify initial timeout and end of speech timeout

poul-kg opened this issue · 0 comments

I've noticed the following:

export class RecognizerConfig {
    private recognitionMode: RecognitionMode = RecognitionMode.Interactive;
    private language: string;
    private format: SpeechResultFormat;
    private speechConfig: SpeechConfig;
    private recognitionActivityTimeout: number;

    constructor(
        platformConfig: SpeechConfig,
        recognitionMode: RecognitionMode = RecognitionMode.Interactive,
        language: string = "en-us",
        format: SpeechResultFormat = SpeechResultFormat.Simple) {
        this.speechConfig = platformConfig ? platformConfig : new SpeechConfig(new Context(null, null));
        this.recognitionMode = recognitionMode;
        this.language = language;
        this.format = format;
        this.recognitionActivityTimeout = recognitionMode === RecognitionMode.Interactive ? 8000 : 25000;
    }

  • timeout is set to 8000ms for Interactive mode and to 25000ms for other modes
  • looks like this timeout is only for initial silence
  • it's not end of speech timeout
  • it's not possible to modify it as variable is private and there is no setter method.

Would be nice to have ability to specify both initial and end of speech timeouts in RecognizerConfig via constructor or via some methods