ISpPhrase::Discard (Windows Embedded CE 6.0)
1/6/2010
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.
Syntax
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 Value
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
Header | sapi.h, sapi.idl |
Library | sapilib.lib |
Windows Embedded CE | Windows CE .NET 4.1 and later |