ISpPhrase::Discard (Windows CE 5.0)

Send Feedback

This method discards the requested data from a phrase object. Applications that have no use for certain types of retained data, and will be persisting or serializing the phrase or result objects, may want to discard the unnecessary data. For example, an application performing offline transcription may need to retain only the audio and the final result, so it can call ::Discard with SPDF_ALTERNATES to eliminate the alternate data (possibly including a large amount of private engine data).

Once retained audio is discarded, a call to ISpRecoResult::GetAudio will fail.

HRESULT Discard(DWORD dwValueTypes);

Parameters

  • dwValueTypes
    [in] Value types indicating elements to discard. Possible value types are defined by the SPVALUETYPE enumeration. Multiple values can be combined.

Return Values

The following table shows the possible return values.

Value Description
S_OK Function completed successfully.
E_INVALIDARG dwValueTypes is not a valid value type flag.
FAILED(hr) Appropriate error message.

Example

The following code snippet illustrates the use of this method as inherited from ISpPhrase to discard the retained audio.

HRESULT hr = S_OK;
// .. get a recognition result object from the SR engine
// discard audio
hr = cpRecoResult->Discard(SPDF_AUDIO);
// Check hr
// .. serialize the "shrunken" result to the disk ...

Requirements

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

See Also

ISpPhrase | SAPI Interfaces

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.