Share via


ISpRecoContext (Windows CE 5.0)

Send Feedback

This interface enables applications to create different functional views or contexts of the SR engine. It inherits from ISpEventSource.

Each object implementing this interface can take interest in different speech recognition events, defined by ISpEventSource and use different recognition grammars, defined by ISpRecoGrammar.

When to Implement

The following class IDs (CLSID) can be used with this interface. A complete CLSID listing for all interfaces is in the SAPI Class IDs section.

  • CLSID_SpSharedRecoContext

When to Use

An application must have at least one object implementing ISpRecoContext to receive recognitions. It can create multiple speech recognition context objects to handle different recognition types. For example, a multiple document interface (MDI) application can associate a different context object with each document pane to localize grammar and support event processing.

The application creates a new ISpRecoContext object by calling ISpRecognizer::CreateRecoContext. If the application needs to use a shared recognizer (ISpRecognizer), it can create a shared speech recognition context by calling CoCreateInstance with CLSID_SpSharedRecoContext.

Methods

The following table shows the methods for the ISpRecoContext interface.

Methods Description
Bookmark Sets a bookmark within the current recognition stream.
CreateGrammar Creates a grammar.
DeserializeResult Creates a new result from a serialized result.
GetAudioOptions Gets audio options for a given stream.
GetContextState Gets the state of the speech recognition context.
GetMaxAlternates Gets the maximum number of alternates that the SR engine will retrieve for command and control or proprietary grammars associated with the speech recognition context.
GetRecognizer Gets a reference to the current recognizer object associated with the speech recognition context.
GetStatus Gets status information about the speech recognition context.
GetVoice Gets a reference to the voice associated with the speech recognition context.
GetVoicePurgeEvent Gets SR engine events that stop audio output, and purges the current speaking queue.
Pause Pauses the recognition process to allow SR engine synchronization.
Resume Resumes the SR engine from the paused state and restarts the recognition process.
SetAdaptationData Sends data to the SR engine to update the current language model.
SetAudioOptions Sets the audio options for results from the speech recognition context.
SetContextState Sets the state of the recognition context.
SetMaxAlternates Sets the maximum number of alternates retrieved for command and control grammars.
SetVoice Sets the voice associated with the speech recognition context.
SetVoicePurgeEvent Sets SR engine events that stop audio output, and purges the current speaking queue.

Requirements

OS Versions: Windows CE .NET 4.1 and later.
Header: Sapi.h, Sapi.idl.
Link Library: Sapilib.lib.

See Also

SAPI Interfaces

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.