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

ISpRecoContext::GetVoice

ISpRecoContext::GetVoice retrieves a reference to an ISpVoice object that is associated with the ISpRecoContext object.

HRESULT GetVoice(
   ISpVoice   **ppVoice
);

Parameters

ppVoice
[in] Address of the ISpVoice interface. IUnknown::Release must be called on the ISpVoice interface when finished.

Return values

Value Description
S_OK Function completed successfully.
E_POINTER Invalid pointer.
FAILED(hr) Appropriate error message.

Remarks

If an application previously called ISpRecoContext::SetVoice on the same ISpRecoContext object, the Voice interface retrieved from GetVoice will match that of the SetVoice call. Release must still call the ISpVoice reference for each GetVoice call, even though the interface pointer is the same.

The output format of the ISpVoice will be the same format as the associated audio input format of the SR engine (see ISpRecognizer and ISpSREngine::GetInputAudioFormat). Using the same audio format for input and output source is useful for sound cards that do not support full-duplex audio (i.e., input format must match output format). If the input format quality is lower than the output format quality, the output format quality will be down-sampled to the lower quality.

Applications implementing a "barge-in" type functionality will need to tie the Voice object to the SR object. Applications can also use ISpRecoContext::GetVoice (see ISpRecoContext::SetVoicePurgeEvent).

Related Samples

The CoffeeS3 Sample application uses ISpRecoContext::GetVoice and the "barge-in" functionality. 

Example

The following code snippet illustrates the use of ISpRecoContext::GetVoice and "barge-in" setup

    HRESULT hr = S_OK;

    // create a shared recognition context
    hr = cpRecoContext.CoCreateInstance(CLSID_SpSharedRecoContext);
    // Check hr

    // create a voice from the context (with same audio format as context)
    hr = cpRecoContext->GetVoice(&cpVoice);
    // Check hr

    // tell the associated Voice to stop speaking when the SR Engine hears a recognizable sound
    hr = cpRecoContext->SetVoicePurgeEvent(SPFEI(SPEI_SOUND_START));
    // 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