Rate this page:

ASR

ASR class provides speech recognition capabilities. Audio stream can be sent to the ASR instance from a Call, Player or Conference. Language or dictionary should be passed to the VoxEngine.createASR function. Add the following line to your scenario code to use the class:

require(Modules.ASR);

Constructors

constructor

Copy URL

Parameters

  • id:

    string

  • lang:

    string

  • dict:

    string

Methods

addEventListener

Copy URL
addEventListener(event: 

ASREvents

,
callback:

Function

):

void

Adds a handler for the specified ASREvents event. Use only functions as handlers; anything except a function leads to the error and scenario termination when a handler is called

Parameters

  • event:

    ASREvents

    Event class (i.e., ASREvents.Stopped)

  • callback:

    Function

    Handler function. A single parameter is passed - object with event information

Returns

  • type:

    void

removeEventListener

Copy URL
removeEventListener(event: 

ASREvents

,
callback:

Function

):

void

Removes a handler for the specified ASREvents event

Parameters

  • event:

    ASREvents

    Event class (i.e., ASREvents.Stopped)

  • callback:

    Function

    Optional

    Handler function. If not specified, all event listeners are removed

Returns

  • type:

    void

stop

Copy URL
stop(): 

void

Stops recognition. Triggers the ASREvents.Stopped event. You must not call any other ASR functions/handlers after the ASR.stop call.

Returns

  • type:

    void