Wrp Callback Functions
These are the WRP library callback functions included in <Sample Program 1.1.2> and later.
You can set callback functions that are called when events such as WebSocket connection, disconnection, start and end of speech recognition occur. The callback functions that can be set are as follows: *You don't need to set all of them. Please set and use only the ones you need.
Wrp.connectStarted = new function() { ... }
Called when the connection process to the speech recognition server starts.
Wrp.connectEnded = new function() { ... }
Called when the connection to the speech recognition server is completed.
Wrp.disconnectStarted = new function() { ... }
Called when the disconnection process from the speech recognition server starts.
Wrp.disconnectEnded = new function() { ... }
Called when the disconnection from the speech recognition server is completed.
Wrp.feedDataResumeStarted = new function() { ... }
Called when the recording start process begins.
Wrp.feedDataResumeEnded = new function() { ... }
Called when the recording start process is completed (→ enters recording state).
Wrp.feedDataPauseStarted = new function() { ... }
Called when the recording stop process begins.
Wrp.feedDataPauseEnded = new function(reason) { ... }
Called when the recording stop process is completed (→ enters non-recording state).
Wrp.utteranceStarted = new function(startTime) { ... }
Called when the start of an utterance is detected.
Wrp.utteranceEnded = new function(endTime) { ... }
Called when the end of an utterance is detected.
Wrp.resultCreated = new function() { ... }
Called when recognition starts.
Wrp.resultUpdated = new function(result) { ... }
Called during recognition.
result: Intermediate recognition result (JSON) for the utterance segment being processed. For details, please see "WebSocket Interface" > Event Packets > U Event Packet.
Wrp.resultFinalized = new function(result) { ... }
Called when recognition is completed.
result: Final recognition result (JSON) for the utterance segment. For details, please see "WebSocket Interface" > Event Packets > A Event Packet.
Wrp.issueStarted = new function() { ... }
Called when the process of obtaining a one-time APPKEY (service authentication key string) starts.
Wrp.issueEnded = new function() { ... }
Called when obtaining a one-time APPKEY (service authentication key string) is completed.
Wrp.TRACE = function(message) { ... }
For debugging. Called when a log output request is made.