CHMlib Logo Leading Translation Management System for Translation Agencies, Top Translation Management Software for Freelance Translators, Time Tracking Software, Word Count, Character Count and Line Count Software, Computer Assisted Translation Tool for Easy Word Count, Clipboard Character Count Software, User-Friendly Translation Memory Software, Terminology Management Software, Terminology Management Server, Microsoft Glossary Software, Dictionary of Acronyms, Social Network for Translators and Translation Agencies, Acronyms and Abbreviations Search Engine, Russian Translation Lab, Ukrainian Translation Lab.
You are reading help file online using chmlib.com
CrisisHelper - First Aid in Tough Times of World Economic Crisis


The Microsoft.com Speech website Microsoft Speech SDK

SAPI 5.1

ISpPhrase::GetSerializedPhrase

ISpPhrase::GetSerializedPhrase returns the phrase information in serialized form.


HRESULT GetSerializedPhrase(
   SPSERIALIZEDPHRASE   **ppCoMemPhrase
;)

Parameters

ppCoMemPhrase
[out] Address of a pointer which will be initialized to point to the serialized phrase data. The block of memory is created by CoTaskMemAlloc and must be manually freed with CoTaskMemFree when no longer needed.

Return values

Value Description
S_OK Function completed successfully.
E_POINTER ppCoMemPhrase is invalid or bad.
SPERR_UNINITIALIZED Phrase is uninitialized.
E_OUTOFMEMORY Exceeded available memory.

Remarks

The caller passes in the address of a pointer which is initialized to point to a block of memory which is allocated using CoTaskMemAlloc. It is the caller's responsibility to call CoTaskMemFree to free this object. The structure returned is defined to be a SPSERIALIZEDPHRASE. However, the actual size of the block is contained in (*ppCoMemPhrase)->ulSerializedSize. This size includes the size of the SPSERIALIZEDPHRASE structure. The phrase structure can be saved to a file, and later restored by calling ISpPhraseBuilder::InitFromSerializedPhrase.

An application that will not need recognition alternates or retained audio and needs to save space, can serialize only the phrase information (e.g., phrase text, rule name, SR engine ID, etc.).

Example

The following code snippet illustrates the use ISpRecoResult::GetSerializedPhrase as inherited from ISpPhrase to serialize only the phrase portion of a result object.

    HRESULT hr = S_OK;

    // ... obtain a recognition result object from the recognizer...

    SPSERIALIZEDPHRASE* pSerializedPhrase = NULL;

    // get the recognized phrase object
    hr = cpRecoResult->GetSerializdPhrase(&pSerializedPhrase);
    // Check hr


You are reading help file online using chmlib.com

If you want your help file to be removed or added please send e-mail to chmlibcom@gmail.com
Partner sites: Logo Design, Simple Anti-Crisis Accounting Software, Voice Search for Web