ISpSRAlternates::Commit (SAPI 5.4)
ISpSRAlternates::Commit instructs the alternate analyzer to update the speech recognition (SR) engine's acoustic and/or language model based on the selected alternate phrase, versus the original phrase.
SAPI calls Commit when an application calls ISpPhraseAlt::Commit. The alternate analyzer compares the original phrase (see SPPHRASEALTREQUEST.pPhrase) and the new alternate phrase (see SPPHRASEALT) to improve recognition accuracy.
Depending on the manufacturer, the SR engine might provide a custom related data block (see SPPHRASEALTREQUEST.pvResultExtra) so that the analyzer can synchronize the data block with the new alternate phrase. If the user wants to re-analyze the new phrase (after being serialized and deserialized), or if the user chooses a different alternate, SAPI provides the revised data block to the analyzer.
The alternate analyzer communicates with the SR engine by retrieving the ISpRecoContext interface from the SPPHRASEALTREQUEST.pRecoContext field, and querying (see IUnknown::QueryInterface) for the SR engine's private extension (see ISpPrivateEngineCall).
HRESULT Commit( SPPHRASEALTREQUEST *pAltRequest, SPPHRASEALT *pAlt, void **ppvResultExtra, ULONG *pcbResultExtra );
- [in] A pointer to the structure of type SPPHRASEALTREQUEST that specifies the original alternate request and phrase information.
- [in] A pointer to the structure of type SPPHRASEALT that specifies the application-chosen alternate phrase.
- [out] Additional engine-defined information that should be included with recognition result.
- [out] Size, in bytes, of ppvResultExtra.
|S_OK||Function completed successfully.|
|FAILED (hr)||Appropriate error message.|