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

ISpAudio::SetState

ISpAudio::SetState sets the state of the audio device.

HRESULT SetState(
   SPAUDIOSTATE   NewState,
   ULONGLONG      ullReserved
);

Parameters

NewState
[in] The flag of type SPAUDIOSTATE for the new state of the audio device.
ullReserved
[in] Reserved, do not use. This value must be zero.

Return values

Value Description
S_OK Function completed successfully.
E_INVALIDARG ullReserved is not zero or NewState is not one of the allowed values.
SPERR_DEVICE_BUSY Hardware device is in use by another thread or process.
SPERR_UNSUPPORTED_FORMAT Current format set by ISpAudio::SetFormat is not supported by the hardware device.

Remarks

When transitioning from the SPAS_CLOSED state to any other state, the caller should be ready to handle various error conditions, specifically, SPERR_UNSUPPORTED_FORMAT and SPERR_DEVICE_BUSY. Many multi-media devices do not correctly report their capabilities for handling different audio formats and fail only when an attempt is made to open the device.

Also, in many older systems, audio output devices can be opened only by a single process. In all current versions of Windows, only a single process can open an audio input device. Therefore, SPERR_DEVICE_BUSY will return if an attempt is made to open a device that is being used by a different process or thread.

On some older sound cards, recording and playback are not possible simultaneously or only possible at the same frequency. An application making use of the input and output audio should be aware of this and in particular attempt to gracefully degrade from higher quality frequencies to the same frequency for both if the sound card makes this necessary.

In general, applications need not change the state of the audio device directly. With the shared recognizer in particular, this will often cause unexpected results. SAPI will automatically manage the state of the audio device based on the state of all the grammars, recognition contexts and the recognizer instance.



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