📄 sapi.cpp
字号:
return result;
}
void ISpeechVoice::SetRefAudioOutputStream(LPDISPATCH newValue)
{
static BYTE parms[] =
VTS_DISPATCH;
InvokeHelper(0x4, DISPATCH_PROPERTYPUTREF, VT_EMPTY, NULL, parms,
newValue);
}
long ISpeechVoice::GetRate()
{
long result;
InvokeHelper(0x5, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
void ISpeechVoice::SetRate(long nNewValue)
{
static BYTE parms[] =
VTS_I4;
InvokeHelper(0x5, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
nNewValue);
}
long ISpeechVoice::GetVolume()
{
long result;
InvokeHelper(0x6, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
void ISpeechVoice::SetVolume(long nNewValue)
{
static BYTE parms[] =
VTS_I4;
InvokeHelper(0x6, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
nNewValue);
}
long ISpeechVoice::GetEventInterests()
{
long result;
InvokeHelper(0x8, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
void ISpeechVoice::SetEventInterests(long nNewValue)
{
static BYTE parms[] =
VTS_I4;
InvokeHelper(0x8, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
nNewValue);
}
void ISpeechVoice::SetPriority(long nNewValue)
{
static BYTE parms[] =
VTS_I4;
InvokeHelper(0x9, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
nNewValue);
}
long ISpeechVoice::GetPriority()
{
long result;
InvokeHelper(0x9, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
void ISpeechVoice::SetAlertBoundary(long nNewValue)
{
static BYTE parms[] =
VTS_I4;
InvokeHelper(0xa, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
nNewValue);
}
long ISpeechVoice::GetAlertBoundary()
{
long result;
InvokeHelper(0xa, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
void ISpeechVoice::SetSynchronousSpeakTimeout(long nNewValue)
{
static BYTE parms[] =
VTS_I4;
InvokeHelper(0xb, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
nNewValue);
}
long ISpeechVoice::GetSynchronousSpeakTimeout()
{
long result;
InvokeHelper(0xb, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
long ISpeechVoice::Speak(LPCTSTR Text, long Flags)
{
long result;
static BYTE parms[] =
VTS_BSTR VTS_I4;
InvokeHelper(0xc, DISPATCH_METHOD, VT_I4, (void*)&result, parms,
Text, Flags);
return result;
}
long ISpeechVoice::SpeakStream(LPDISPATCH Stream, long Flags)
{
long result;
static BYTE parms[] =
VTS_DISPATCH VTS_I4;
InvokeHelper(0xd, DISPATCH_METHOD, VT_I4, (void*)&result, parms,
Stream, Flags);
return result;
}
void ISpeechVoice::Pause()
{
InvokeHelper(0xe, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
}
void ISpeechVoice::Resume()
{
InvokeHelper(0xf, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
}
long ISpeechVoice::Skip(LPCTSTR Type, long NumItems)
{
long result;
static BYTE parms[] =
VTS_BSTR VTS_I4;
InvokeHelper(0x10, DISPATCH_METHOD, VT_I4, (void*)&result, parms,
Type, NumItems);
return result;
}
LPDISPATCH ISpeechVoice::GetVoices(LPCTSTR RequiredAttributes, LPCTSTR OptionalAttributes)
{
LPDISPATCH result;
static BYTE parms[] =
VTS_BSTR VTS_BSTR;
InvokeHelper(0x11, DISPATCH_METHOD, VT_DISPATCH, (void*)&result, parms,
RequiredAttributes, OptionalAttributes);
return result;
}
LPDISPATCH ISpeechVoice::GetAudioOutputs(LPCTSTR RequiredAttributes, LPCTSTR OptionalAttributes)
{
LPDISPATCH result;
static BYTE parms[] =
VTS_BSTR VTS_BSTR;
InvokeHelper(0x12, DISPATCH_METHOD, VT_DISPATCH, (void*)&result, parms,
RequiredAttributes, OptionalAttributes);
return result;
}
BOOL ISpeechVoice::WaitUntilDone(long msTimeout)
{
BOOL result;
static BYTE parms[] =
VTS_I4;
InvokeHelper(0x13, DISPATCH_METHOD, VT_BOOL, (void*)&result, parms,
msTimeout);
return result;
}
BOOL ISpeechVoice::IsUISupported(LPCTSTR TypeOfUI, VARIANT* ExtraData)
{
BOOL result;
static BYTE parms[] =
VTS_BSTR VTS_PVARIANT;
InvokeHelper(0x15, DISPATCH_METHOD, VT_BOOL, (void*)&result, parms,
TypeOfUI, ExtraData);
return result;
}
void ISpeechVoice::DisplayUI(long hWndParent, LPCTSTR Title, LPCTSTR TypeOfUI, VARIANT* ExtraData)
{
static BYTE parms[] =
VTS_I4 VTS_BSTR VTS_BSTR VTS_PVARIANT;
InvokeHelper(0x16, DISPATCH_METHOD, VT_EMPTY, NULL, parms,
hWndParent, Title, TypeOfUI, ExtraData);
}
/////////////////////////////////////////////////////////////////////////////
// ISpeechVoiceStatus properties
/////////////////////////////////////////////////////////////////////////////
// ISpeechVoiceStatus operations
long ISpeechVoiceStatus::GetCurrentStreamNumber()
{
long result;
InvokeHelper(0x1, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
long ISpeechVoiceStatus::GetLastStreamNumberQueued()
{
long result;
InvokeHelper(0x2, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
long ISpeechVoiceStatus::GetLastHResult()
{
long result;
InvokeHelper(0x3, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
long ISpeechVoiceStatus::GetRunningState()
{
long result;
InvokeHelper(0x4, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
long ISpeechVoiceStatus::GetInputWordPosition()
{
long result;
InvokeHelper(0x5, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
long ISpeechVoiceStatus::GetInputWordLength()
{
long result;
InvokeHelper(0x6, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
long ISpeechVoiceStatus::GetInputSentencePosition()
{
long result;
InvokeHelper(0x7, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
long ISpeechVoiceStatus::GetInputSentenceLength()
{
long result;
InvokeHelper(0x8, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
CString ISpeechVoiceStatus::GetLastBookmark()
{
CString result;
InvokeHelper(0x9, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
return result;
}
short ISpeechVoiceStatus::GetPhonemeId()
{
short result;
InvokeHelper(0xb, DISPATCH_PROPERTYGET, VT_I2, (void*)&result, NULL);
return result;
}
short ISpeechVoiceStatus::GetVisemeId()
{
short result;
InvokeHelper(0xc, DISPATCH_PROPERTYGET, VT_I2, (void*)&result, NULL);
return result;
}
/////////////////////////////////////////////////////////////////////////////
// _ISpeechVoiceEvents properties
/////////////////////////////////////////////////////////////////////////////
// _ISpeechVoiceEvents operations
void _ISpeechVoiceEvents::StartStream(long StreamNumber, const VARIANT& StreamPosition)
{
static BYTE parms[] =
VTS_I4 VTS_VARIANT;
InvokeHelper(0x1, DISPATCH_METHOD, VT_EMPTY, NULL, parms,
StreamNumber, &StreamPosition);
}
void _ISpeechVoiceEvents::EndStream(long StreamNumber, const VARIANT& StreamPosition)
{
static BYTE parms[] =
VTS_I4 VTS_VARIANT;
InvokeHelper(0x2, DISPATCH_METHOD, VT_EMPTY, NULL, parms,
StreamNumber, &StreamPosition);
}
void _ISpeechVoiceEvents::VoiceChange(long StreamNumber, const VARIANT& StreamPosition, LPDISPATCH VoiceObjectToken)
{
static BYTE parms[] =
VTS_I4 VTS_VARIANT VTS_DISPATCH;
InvokeHelper(0x3, DISPATCH_METHOD, VT_EMPTY, NULL, parms,
StreamNumber, &StreamPosition, VoiceObjectToken);
}
void _ISpeechVoiceEvents::Bookmark(long StreamNumber, const VARIANT& StreamPosition, LPCTSTR Bookmark, long BookmarkId)
{
static BYTE parms[] =
VTS_I4 VTS_VARIANT VTS_BSTR VTS_I4;
InvokeHelper(0x4, DISPATCH_METHOD, VT_EMPTY, NULL, parms,
StreamNumber, &StreamPosition, Bookmark, BookmarkId);
}
void _ISpeechVoiceEvents::Word(long StreamNumber, const VARIANT& StreamPosition, long CharacterPosition, long Length)
{
static BYTE parms[] =
VTS_I4 VTS_VARIANT VTS_I4 VTS_I4;
InvokeHelper(0x5, DISPATCH_METHOD, VT_EMPTY, NULL, parms,
StreamNumber, &StreamPosition, CharacterPosition, Length);
}
void _ISpeechVoiceEvents::Sentence(long StreamNumber, const VARIANT& StreamPosition, long CharacterPosition, long Length)
{
static BYTE parms[] =
VTS_I4 VTS_VARIANT VTS_I4 VTS_I4;
InvokeHelper(0x7, DISPATCH_METHOD, VT_EMPTY, NULL, parms,
StreamNumber, &StreamPosition, CharacterPosition, Length);
}
void _ISpeechVoiceEvents::Phoneme(long StreamNumber, const VARIANT& StreamPosition, long Duration, short NextPhoneId, long Feature, short CurrentPhoneId)
{
static BYTE parms[] =
VTS_I4 VTS_VARIANT VTS_I4 VTS_I2 VTS_I4 VTS_I2;
InvokeHelper(0x6, DISPATCH_METHOD, VT_EMPTY, NULL, parms,
StreamNumber, &StreamPosition, Duration, NextPhoneId, Feature, CurrentPhoneId);
}
void _ISpeechVoiceEvents::Viseme(long StreamNumber, const VARIANT& StreamPosition, long Duration, long NextVisemeId, long Feature, long CurrentVisemeId)
{
static BYTE parms[] =
VTS_I4 VTS_VARIANT VTS_I4 VTS_I4 VTS_I4 VTS_I4;
InvokeHelper(0x8, DISPATCH_METHOD, VT_EMPTY, NULL, parms,
StreamNumber, &StreamPosition, Duration, NextVisemeId, Feature, CurrentVisemeId);
}
void _ISpeechVoiceEvents::AudioLevel(long StreamNumber, const VARIANT& StreamPosition, long AudioLevel)
{
static BYTE parms[] =
VTS_I4 VTS_VARIANT VTS_I4;
InvokeHelper(0x9, DISPATCH_METHOD, VT_EMPTY, NULL, parms,
StreamNumber, &StreamPosition, AudioLevel);
}
void _ISpeechVoiceEvents::EnginePrivate(long StreamNumber, long StreamPosition, const VARIANT& EngineData)
{
static BYTE parms[] =
VTS_I4 VTS_I4 VTS_VARIANT;
InvokeHelper(0xa, DISPATCH_METHOD, VT_EMPTY, NULL, parms,
StreamNumber, StreamPosition, &EngineData);
}
/////////////////////////////////////////////////////////////////////////////
// ISpeechRecognizer properties
/////////////////////////////////////////////////////////////////////////////
// ISpeechRecognizer operations
void ISpeechRecognizer::SetRefRecognizer(LPDISPATCH newValue)
{
static BYTE parms[] =
VTS_DISPATCH;
InvokeHelper(0x1, DISPATCH_PROPERTYPUTREF, VT_EMPTY, NULL, parms,
newValue);
}
LPDISPATCH ISpeechRecognizer::GetRecognizer()
{
LPDISPATCH result;
InvokeHelper(0x1, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL);
return result;
}
void ISpeechRecognizer::SetRefAudioInput(LPDISPATCH newValue)
{
static BYTE parms[] =
VTS_DISPATCH;
InvokeHelper(0x3, DISPATCH_PROPERTYPUTREF, VT_EMPTY, NULL, parms,
newValue);
}
LPDISPATCH ISpeechRecognizer::GetAudioInput()
{
LPDISPATCH result;
InvokeHelper(0x3, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL);
return result;
}
void ISpeechRecognizer::SetRefAudioInputStream(LPDISPATCH newValue)
{
static BYTE parms[] =
VTS_DISPATCH;
InvokeHelper(0x4, DISPATCH_PROPERTYPUTREF, VT_EMPTY, NULL, parms,
newValue);
}
LPDISPATCH ISpeechRecognizer::GetAudioInputStream()
{
LPDISPATCH result;
InvokeHelper(0x4, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL);
return result;
}
BOOL ISpeechRecognizer::GetIsShared()
{
BOOL result;
InvokeHelper(0x5, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
return result;
}
void ISpeechRecognizer::SetState(long nNewValue)
{
static BYTE parms[] =
VTS_I4;
InvokeHelper(0x6, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
nNewValue);
}
long ISpeechRecognizer::GetState()
{
long result;
InvokeHelper(0x6, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
LPDISPATCH ISpeechRecognizer::GetStatus()
{
LPDISPATCH result;
InvokeHelper(0x7, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL);
return result;
}
void ISpeechRecognizer::SetRefProfile(LPDISPATCH newValue)
{
static BYTE parms[] =
VTS_DISPATCH;
InvokeHelper(0x8, DISPATCH_PROPERTYPUTREF, VT_EMPTY, NULL, parms,
newValue);
}
LPDISPATCH ISpeechRecognizer::GetProfile()
{
LPDISPATCH result;
InvokeHelper(0x8, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL);
return result;
}
void ISpeechRecognizer::EmulateRecognition(const VARIANT& TextElements, VARIANT* ElementDisplayAttributes, long LanguageId)
{
static BYTE parms[] =
VTS_VARIANT VTS_PVARIANT VTS_I4;
InvokeHelper(0x9, DISPATCH_METHOD, VT_EMPTY, NULL, parms,
&TextElements, ElementDisplayAttributes, LanguageId);
}
LPDISPATCH ISpeechRecognizer::CreateRecoContext()
{
LPDISPATCH result;
InvokeHelper(0xa, DISPATCH_METHOD, VT_DISPATCH, (void*)&result, NULL);
return result;
}
LPDISPATCH ISpeechRecognizer::GetFormat(long Type)
{
LPDISPATCH result;
static BYTE parms[] =
VTS_I4;
InvokeHelper(0xb, DISPATCH_METHOD, VT_DISPATCH, (void*)&result, parms,
Type);
return result;
}
BOOL ISpeechRecognizer::IsUISupported(LPCTSTR TypeOfUI, VARIANT* ExtraData)
{
BOOL result;
static BYTE parms[] =
VTS_BSTR VTS_PVARIANT;
InvokeHelper(0x10, DISPATCH_METHOD, VT_BOOL, (void*)&result, parms,
TypeOfUI, ExtraData);
return result;
}
void ISpeechRecognizer::DisplayUI(long hWndParent, LPCTSTR Title, LPCTSTR TypeOfUI, VARIANT* ExtraData)
{
static BYTE parms[] =
VTS_I4 VTS_BSTR VTS_BSTR VTS_PVARIANT;
InvokeHelper(0x11, DISPATCH_METHOD, VT_EMPTY, NULL, parms,
hWndParent, Title, TypeOfUI, ExtraData);
}
LPDISPATCH ISpeechRecognizer::GetRecognizers(LPCTSTR RequiredAttributes, LPCTSTR OptionalAttributes)
{
LPDISPATCH result;
static BYTE parms[] =
VTS_BSTR VTS_BSTR;
InvokeHelper(0x12, DISPATCH_METHOD, VT_DISPATCH, (void*)&result, parms,
RequiredAttributes, OptionalAttributes);
return result;
}
LPDISPATCH ISpeechRecognizer::GetAudioInputs(LPCTSTR RequiredAttributes, LPCTSTR OptionalAttributes)
{
LPDISPATCH result;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -