ISpRecoGrammar::LoadDictation (Windows CE 5.0)

Send Feedback

This method loads a dictation topic into the speech recognition grammar object and the SR engine. See also ISpSREngine::OnCreateGrammar.

HRESULT LoadDictation(const WCHAR* pszTopicName,SPLOADOPTIONS Options);

Parameters

  • pszTopicName
    [in, optional] Pointer to the topic name. If NULL, then general dictation is loaded. See Remarks section.
  • Options
    [in] Value indicating if the file should be loaded dynamically. Possible values are defined for the SPLOADOPTIONS enumeration. This value must be SPLO_STATIC.

Return Values

The following table shows the possible return values.

Value Description
S_OK Function completed successfully.
E_INVALIDARG pszTopicName is invalid or bad. Alternatively, Options is not SPLO_STATIC.
FAILED(hr) Appropriate error message.

Remarks

SAPI currently defines one specialized dictation topic: SPTOPIC_SPELLING. SR engines are not required to support specialized dictation topic (including spelling).

See the SR engine vendor for information on what specialized dictation topics if any are supported.

Example

The following code snippet illustrates the use of this method.

HRESULT hr = S_OK;
// create a grammar object
hr = cpRecoContext->CreateGrammar(GRAM_ID, &cpRecoGrammar);
// Check hr
// load the general Dictation topic
hr = cpRecoGrammar->LoadDictation(NULL, SPLO_STATIC);
// Check hr
// start the Dictation topic to receive recognitions
hr = cpRecoGrammar->SetDictationState(SPRS_ACTIVE);
// check hr

Requirements

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

See Also

ISpRecoGrammar | SAPI Interfaces

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.