SpeechRecoContext SetAdaptationData Method

Microsoft Speech SDK

Intelligent Interface Technologies Home Page Microsoft Speech SDK

Speech Automation 5.1

Interface: ISpeechRecoContext

SetAdaptationData Method


The SetAdaptationData method passes the speech recognition (SR) engine a string of adaptation data.

An application can improve recognition accuracy for dictating uncommon words, or uncommon word groupings by training the SR engine for the new words or word groupings. An application creates or obtains typical text and sends the results to the engine using the SetAdaptationData method.


SpeechRecoContext.SetAdaptationData(
     AdaptationString As String
)

Parameters

AdaptationString
Specifies the AdaptationString.

Return Value

None.


Remarks

Applications using adaptation data should break the data into small sections (1KB or less) and submit the sections individually. First, specify interest in adaptation events using the ISpeechRecoContext.EventInterests method. The Adaptation event interest is on by default. Then, send a small data section to the SR engine using the SetAdaptationData method, and wait for an ISpeechRecoContext.Adaptation event, which indicates that the adaptation data has been processed. Send all successive data sections in this way. Finally, use the EventInterests method to turn off Adaptation events. Since this event is returned only after an explicit SetAdaptationData call, the event interest does not need to be removed unless an excessive number of words is added and the processing time becomes unacceptable. The Adaptation event indicates that the engine has processed the AdaptationString and that it is ready to accept another SetAdaptationData call.

Example

The following code snippet demonstrates adding an uncommon word. After the word is adapted by the recognizer, this sample posts a message to a hypothetical Label1 in the application. The sample assumes a valid RC (as the recognition context).

RC.SetAdaptationData ("Simmiting")

'Speech processing code here

Private Sub RC_Adaptation(ByVal StreamNumber As Long, ByVal StreamPosition As Variant)
    Label1.Caption = "Word added"
End Sub