Sketch-thru-Plan Speech Connector
    Preparing search index...

    Stp interface to speech recognition engine

    interface ISpeechRecognizer {
        onError: ((error: Error) => void) | undefined;
        onRecognized: ((result: ISpeechRecoResult | null) => void) | undefined;
        onRecognizing: ((snippet: string) => void) | undefined;
        recognizeOnce(maxRetries?: number): Promise<ISpeechRecoResult | null>;
        startRecognizing(): void;
        stopRecognizing(wait?: number): void;
    }

    Implemented by

    Index

    Properties

    onError: ((error: Error) => void) | undefined

    Optional event handler invoked when there is a recognition error

    onRecognized: ((result: ISpeechRecoResult | null) => void) | undefined

    Event handler invoked whenever the recognizer has a complete phrase to return

    onRecognizing: ((snippet: string) => void) | undefined

    Optional event handler invoked whenever the recognizer has a partial recognition available

    Methods

    • Activate the microphone and attempt to recognize speech in the next few seconds Ideally, the recognition would include 2s of audio before the call, drawing from some buffer

      Parameters

      • OptionalmaxRetries: number

        Number of time to retry before returning an error

      Returns Promise<ISpeechRecoResult | null>

      Recognized items/hypotheses, or null if nothing was recognized

    • Start the recognition process. Intermediate results are returned via the onRecognizing event; final results (phrase) are returned via the onRecognized event The expectation is that speech recognition is started at the beginning of a sketch, and stopped sometime after the end of the sketch

      Returns void

    • Stop the recognition process. Is normally called at the end of a sketch action

      Parameters

      • Optionalwait: number

        Time in seconds to wait before stopping recognition

      Returns void