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::GetAudio

ISpRecoResult::GetAudio creates an audio stream of the requested words from the audio data in the result object.

HRESULT GetAudio(
   ULONG              ulStartElement,
   ULONG              cElements,
   ISpStreamFormat  **ppStream
); 

Parameters

ulStartElement
[in] Value specifying from which element in the result data to start the audio stream.
cElements
[in] Value specifying the total number of words.
ppStream
[out] Address that will receive a pointer to an ISpStreamFormat object containing the audio data requested.

Return values

Value Description
S_OK Function completed successfully.
E_INVALIDARG cElements is zero or the expected number of elements to count exceeds the number available.
E_POINTER ppStream is an invalid pointer.
SPERR_NO_AUDIO_DATA This result object does not have any audio data.
FAILED(hr) Appropriate error message.

Remarks

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

An application can find the time offsets for each element by examining the SPPHRASE object retrieved using ISpRecoResult::GetPhrase.

Example

The following code snippet illustrates the use ISpRecoResult::GetAudio to retrieve the retained audio.

    HRESULT hr = S_OK;

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

    hr = cpRecoResult->GetAudio( 0, 0, &cpStreamFormat );
    // Check hr

    // check the format of the stream for fun...
    hr = cpStreamFormat->GetFormat(&formatId, &pWaveFormatEx);
    // 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