Win32 API 日本語リファレンス
ホームMedia.Speech › ISpeechRecoGrammar

ISpeechRecoGrammar

COMIDispatch (デュアル)
IDispatch を実装(デュアルインターフェース)。HSP では comobj 経由でメソッド名による遅延バインド呼び出しができます(vtableインデックス不要)。
IIDb6d6f79f-2158-4e50-b5bc-9a9ccd852a09継承元IDispatch呼び出し名前(IDispatch) または vtbl自前メソッド開始 vtbl7

メソッド 19

vtbl = vtable インデックス(0始まり)。IDispatch 実装のため HSP ではメソッド名でも呼べます(上記)。低レベルの index 呼び出し用に vtbl も掲載。0〜2 は IUnknown。

vtbl 7 HRESULT get_Id(VARIANT* Id)
IdVARIANT*outこの文法の識別子を受け取るVARIANTポインタ。
vtbl 8 HRESULT get_RecoContext(ISpeechRecoContext** RecoContext)
RecoContextISpeechRecoContext**outこの文法が属する認識コンテキスト(ISpeechRecoContext)を受け取るポインタ。
vtbl 9 HRESULT put_State(SpeechGrammarState State)
StateSpeechGrammarStatein文法の状態(SpeechGrammarState: 有効/無効)を設定する。
vtbl 10 HRESULT get_State(SpeechGrammarState* State)
StateSpeechGrammarState*out文法の現在状態(SpeechGrammarState)を受け取るポインタ。
vtbl 11 HRESULT get_Rules(ISpeechGrammarRules** Rules)
RulesISpeechGrammarRules**outこの文法に含まれるルール集合(ISpeechGrammarRules)を受け取るポインタ。
vtbl 12 HRESULT Reset(INT NewLanguage)
NewLanguageINTin文法を初期化し再設定する言語ID(LCID)。0で既定。
vtbl 13 HRESULT CmdLoadFromFile(LPWSTR FileName, SpeechLoadOption LoadOption)
FileNameLPWSTRin読み込むコマンド&コントロール文法ファイルのパス。
LoadOptionSpeechLoadOptionin読み込み方法(SpeechLoadOption: 静的/動的)。
vtbl 14 HRESULT CmdLoadFromObject(LPWSTR ClassId, LPWSTR GrammarName, SpeechLoadOption LoadOption)
ClassIdLPWSTRin文法を提供するCOMオブジェクトのクラスID(ProgIDまたはCLSID)。
GrammarNameLPWSTRinロードする文法の名前。
LoadOptionSpeechLoadOptionin読み込み方法(SpeechLoadOption: 静的/動的)。
vtbl 15 HRESULT CmdLoadFromResource(INT hModule, VARIANT ResourceName, VARIANT ResourceType, INT LanguageId, SpeechLoadOption LoadOption)
hModuleINTinリソースを含むモジュールのハンドル(整数)。
ResourceNameVARIANTinリソース名を保持するVARIANT。
ResourceTypeVARIANTinリソース種別を保持するVARIANT。
LanguageIdINTinリソースの言語ID(LCID)。
LoadOptionSpeechLoadOptionin読み込み方法(SpeechLoadOption: 静的/動的)。
vtbl 16 HRESULT CmdLoadFromMemory(VARIANT GrammarData, SpeechLoadOption LoadOption)
GrammarDataVARIANTinメモリ上の文法バイナリを保持するVARIANT。
LoadOptionSpeechLoadOptionin読み込み方法(SpeechLoadOption: 静的/動的)。
vtbl 17 HRESULT CmdLoadFromProprietaryGrammar(LPWSTR ProprietaryGuid, LPWSTR ProprietaryString, VARIANT ProprietaryData, SpeechLoadOption LoadOption)
ProprietaryGuidLPWSTRin独自文法エンジンを識別するGUID文字列。
ProprietaryStringLPWSTRin独自文法エンジンへ渡す文字列パラメータ。
ProprietaryDataVARIANTin独自文法エンジンへ渡すバイナリデータを保持するVARIANT。
LoadOptionSpeechLoadOptionin読み込み方法(SpeechLoadOption: 静的/動的)。
vtbl 18 HRESULT CmdSetRuleState(LPWSTR Name, SpeechRuleState State)
NameLPWSTRin状態を変更するルールの名前。
StateSpeechRuleStateinルールの状態(SpeechRuleState: 有効/無効)を設定する。
vtbl 19 HRESULT CmdSetRuleIdState(INT RuleId, SpeechRuleState State)
RuleIdINTin状態を変更するルールの数値ID。
StateSpeechRuleStateinルールの状態(SpeechRuleState: 有効/無効)を設定する。
vtbl 20 HRESULT DictationLoad(LPWSTR TopicName, SpeechLoadOption LoadOption)
TopicNameLPWSTRin読み込むディクテーショントピック名。NULLで既定トピック。
LoadOptionSpeechLoadOptionin読み込み方法(SpeechLoadOption: 静的/動的)。
vtbl 21 HRESULT DictationUnload()
vtbl 22 HRESULT DictationSetState(SpeechRuleState State)
StateSpeechRuleStateinディクテーション文法の状態(SpeechRuleState: 有効/無効)を設定する。
vtbl 23 HRESULT SetWordSequenceData(LPWSTR Text, INT TextLength, ISpeechTextSelectionInformation* Info)
TextLPWSTRinテキストバッファ機能で参照する語句データ(現在の文書内容等)。
TextLengthINTinTextの文字数。
InfoISpeechTextSelectionInformation*inoptionalテキスト選択情報(ISpeechTextSelectionInformation)。
vtbl 24 HRESULT SetTextSelection(ISpeechTextSelectionInformation* Info)
InfoISpeechTextSelectionInformation*inoptional現在のテキスト選択範囲・カーソル位置情報(ISpeechTextSelectionInformation)。
vtbl 25 HRESULT IsPronounceable(LPWSTR Word, SpeechWordPronounceable* WordPronounceable)
WordLPWSTRin発音可能か判定する単語文字列。
WordPronounceableSpeechWordPronounceable*out判定結果(SpeechWordPronounceable: 不可/辞書/エンジン)を受け取るポインタ。

HSP用 COM定義

#usecom / #comfunc によるHSPのCOM呼び出し定義。数字は vtbl インデックス(0始まり)。クラスIDが無い場合 #usecom の末尾は "{}"、ある場合は "{CLSID}"

出力引数:
#define global IID_ISpeechRecoGrammar "{B6D6F79F-2158-4E50-B5BC-9A9CCD852A09}"
#usecom global ISpeechRecoGrammar IID_ISpeechRecoGrammar "{}"
#comfunc global ISpeechRecoGrammar_get_Id                         7 var
#comfunc global ISpeechRecoGrammar_get_RecoContext                8 sptr
#comfunc global ISpeechRecoGrammar_put_State                      9 int
#comfunc global ISpeechRecoGrammar_get_State                      10 var
#comfunc global ISpeechRecoGrammar_get_Rules                      11 sptr
#comfunc global ISpeechRecoGrammar_Reset                          12 int
#comfunc global ISpeechRecoGrammar_CmdLoadFromFile                13 wstr,int
#comfunc global ISpeechRecoGrammar_CmdLoadFromObject              14 wstr,wstr,int
#comfunc global ISpeechRecoGrammar_CmdLoadFromResource            15 int,int,int,int,int
#comfunc global ISpeechRecoGrammar_CmdLoadFromMemory              16 int,int
#comfunc global ISpeechRecoGrammar_CmdLoadFromProprietaryGrammar  17 wstr,wstr,int,int
#comfunc global ISpeechRecoGrammar_CmdSetRuleState                18 wstr,int
#comfunc global ISpeechRecoGrammar_CmdSetRuleIdState              19 int,int
#comfunc global ISpeechRecoGrammar_DictationLoad                  20 wstr,int
#comfunc global ISpeechRecoGrammar_DictationUnload                21
#comfunc global ISpeechRecoGrammar_DictationSetState              22 int
#comfunc global ISpeechRecoGrammar_SetWordSequenceData            23 wstr,int,sptr
#comfunc global ISpeechRecoGrammar_SetTextSelection               24 sptr
#comfunc global ISpeechRecoGrammar_IsPronounceable                25 wstr,var
; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。
; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。
; ※出力/バッファ引数は var(変数直渡し)。varptr 方式にも切替可。
; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。
; ※IDispatch 実装。HSP では comobj 経由でメソッド名による呼び出しも可能(vtbl 不要)。