Lens Scripting API

    Class ListeningUpdateEventArgs

    The parameter when the callback registered on from VoiceMLModule.onListeningUpdate is called. This is to mark the input audio transcription (and possibly NlpModels as a result) was updated.

    //@input Asset.VoiceMLModule vmlModule
    //@input Component.Text screenTextTranscription

    var onUpdateListeningEventHandler = function(eventArgs){
    var keywordResponses = eventArgs.getKeywordResponses();
    var intentResponses = eventArgs.getIntentResponses();
    var commandResponses = eventArgs.getCommandResponses();

    if(eventArgs.isFinalTranscription || eventArgs.transcription.trim() != ""){
    script.screenTextTranscription.text = eventArgs.transcription;
    }
    }

    script.vmlModule.onListeningUpdate.add(onUpdateListeningEventHandler);

    Hierarchy (View Summary, Expand)

    Index

    Constructors

    Properties

    isFinalTranscription: boolean

    Specifies whether the transcription returned is final, or partial (interim) which can be updated later as the sentence continues.

    transcription: string

    Returns the transcription from the Automatic Speech Recognition.

    Methods

    • Returns an array of QnaResponse elements, each representing an answer to the question in the eventArgs.transcript. It has properties answer(a string with the ML's response) and answerStatusCode, which can take values

      Returns QnaResponse[]

    • Returns true if the object matches or derives from the passed in type.

      Parameters

      • type: string

      Returns boolean

    • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

      Parameters

      Returns boolean

    MMNEPVFCICPMFPCPTTAAATR