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

ISpRecoResult::SpeakAudio

ISpRecoResult::SpeakAudio retrieves and speaks the specified audio. This combines two other methods; first calling ISpRecoResult::GetAudio and then calling ISpVoice::SpeakStream on the parent recognition context.

HRESULT SpeakAudio(
   ULONG    ulStartElement,
   ULONG    cElements,
   DWORD    dwFlags, 
   ULONG   *pulStreamNumber
);

Parameters

ulStartElement
[in] Value specifying with which element to start.
cElements
[in] Value specifying the number of elements contained in the stream. A value of zero speaks all elements.
dwFlags
[in] Value indicating the attributes of the text stream. These values are contained in the SPEAKFLAGS enumeration.
pulStreamNumber
[optional, out] Address of a variable containing the stream number information. If NULL, the stream number will not be retrieved.

Return values

Value Description
S_OK Function completed successfully.
SPERR_NO_AUDIO_DATA Result does not contain audio data.
E_POINTER pulStreamNumber is a non-NULL, bad pointer.
FAILED(hr) Appropriate error message.
Return values may also be those from ISpVoice::SpeakStream.

Remarks

Even if there are no elements, that is, ulStartElement = 0 and cElements = 0, the audio will still be spoken. These are unrecognized results that have no elements, but do have audio.

If the application did not activate retained audio (see ISpRecoContext::SetAudioOptions), or make a previous call to ISpPhrase::Discard and eliminate the retained audio, ::SpeakAudio will fail with SPERR_NO_AUDIO_DATA.

Example

The following code snippet illustrates the use of ISpObjectToken::IsUISupported using SPGUID_EngineProperties.

    HRESULT hr = S_OK;

    // ... get a recognition result object from the SR engine

    // replay the user's spoken audio to the user
    hr = cpRecoResult->SpeakAudio( 0, 0, 0, &ulStreamNum );
    // 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