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

ISpRecognizer::GetInputObjectToken

ISpRecognizer::GetInputObjectToken retrieves the input token object for the stream currently being used.

GetInputObjectToken will always return the default audio input object token when using a shared recognizer.  

HRESULT GetInputObjectToken(
   ISpObjectToken   **ppToken
);

Parameters

ppToken
[out] Gets filled in with the current input object token pointer.

Return values

Value Description
S_OK Function completed successfully.
S_FALSE Function completed successfully, but the input stream object has no object token associated with it.
E_POINTER ppToken is invalid or bad.
SPERR_UNINITIALIZED No audio input has yet been set with SetInput (InProc engine only).
FAILED(hr) Appropriate error message.

Remarks

Applications will not normally need to use this method, but it can be used to find out specific details of the object token that was used to create the audio input stream.

If an application receives feedback from the SR engine that recognition quality is low, (e.g., poor audio signal quality (see SPEI_INTERFERENCE, or that the microphone needs adjustment (see SPEI_REQUEST_UI for SPDUI_MicTraining), etc.), it may be helpful to reconfigure the audio input settings. SAPI defines two specific types of audio UI that an audio object token can provide: volume (SPDUI_AudioVolume) and properties (SPDUI_AudioProperties). An application can use ::GetInputObjectToken, ISpObjectToken::IsUISupported, and ISpObjectToken::DisplayUI to display audio UI in an effort to improve speech recognition.

Example

The following code snippet illustrates the use of ISpRecognizer::GetInputObjectToken when displaying audio UI.

    HRESULT hr = S_OK;

    // check if the current recognizer has an object token
    hr = cpRecognizer->GetInputObjectToken(&cpObjectToken);
    // Check hr == S_OK

    // get the object token's UI
    hr = cpObjectToken->QueryInterface(&cpTokenUI);
    // Check hr

    // check if the default audio input object has UI for Volume 
    hr = cpTokenUI->IsUISupported(SPDUI_AudioVolume, NULL, NULL, NULL, &fSupported);
    // Check hr

    // if fSupported == TRUE, then audio input object has UI for Volume
    // Display the default audio input object's Volume UI 
    hr = cpTokenUI->DisplayUI(MY_HWND, MY_AUDIO_DIALOG_TITLE, SPDUI_AudioVolume, NULL, NULL, cpObjectToken, NULL);
    // 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