Share via


ISpRecognizer::GetRecoProfile

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

8/28/2008

This method gets the current recognition profile token.

A recognition profile represents a single user and training sessions on the system. The user can create, delete and set the current profile by using the Speech Control Panel. SAPI will always create the engine using the current default profile. This method can be used to find which profile is currently being used.

If an application needs to store information in a specific recognition profile, then it can use the ISpObjectToken::GetStorageFileName method.

Syntax

HRESULT GetRecoProfile(
  ISpObjectToken** ppToken
);

Parameters

  • ppToken
    [out] Address of a pointer to an object implementing ISpObjectToken that represents profile information.

Return Value

The following table shows the possible return values.

Value Description

S_OK

Function completed successfully.

E_POINTER

The ppToken is a bad or invalid pointer.

FAILED(hr)

Appropriate error message.

Example

The following code snippet illustrates the use of this method to determine the profile name.

HRESULT hr = S_OK;
// get the current recognizer's recognition profile token
hr = cpRecognizer->GetRecoProfile(&cpObjectToken);
// Check hr
// get the reco profile name (such as the default value of the token)
hr = cpObjectToken->GetStringValue(NULL, &pwszRecoProfileName);
// Check hr

Requirements

Header sapi.h, sapi.idl
Library sapilib.lib
Windows Embedded CE Windows CE .NET 4.1 and later

See Also

Reference

ISpRecognizer
SAPI Interfaces