ホーム › Media.Speech › ISpeechRecoGrammar
ISpeechRecoGrammar
COMIDispatch (デュアル)✅ IDispatch を実装(デュアルインターフェース)。HSP では
comobj 経由でメソッド名による遅延バインド呼び出しができます(vtableインデックス不要)。メソッド 19
vtbl = vtable インデックス(0始まり)。IDispatch 実装のため HSP ではメソッド名でも呼べます(上記)。低レベルの index 呼び出し用に vtbl も掲載。0〜2 は IUnknown。
| Id | VARIANT* | out | この文法の識別子を受け取るVARIANTポインタ。 |
vtbl 8 HRESULT get_RecoContext(ISpeechRecoContext** RecoContext)
| RecoContext | ISpeechRecoContext** | out | この文法が属する認識コンテキスト(ISpeechRecoContext)を受け取るポインタ。 |
vtbl 9 HRESULT put_State(SpeechGrammarState State)
| State | SpeechGrammarState | in | 文法の状態(SpeechGrammarState: 有効/無効)を設定する。 |
vtbl 10 HRESULT get_State(SpeechGrammarState* State)
| State | SpeechGrammarState* | out | 文法の現在状態(SpeechGrammarState)を受け取るポインタ。 |
vtbl 11 HRESULT get_Rules(ISpeechGrammarRules** Rules)
| Rules | ISpeechGrammarRules** | out | この文法に含まれるルール集合(ISpeechGrammarRules)を受け取るポインタ。 |
| NewLanguage | INT | in | 文法を初期化し再設定する言語ID(LCID)。0で既定。 |
vtbl 13 HRESULT CmdLoadFromFile(LPWSTR FileName, SpeechLoadOption LoadOption)
| FileName | LPWSTR | in | 読み込むコマンド&コントロール文法ファイルのパス。 |
| LoadOption | SpeechLoadOption | in | 読み込み方法(SpeechLoadOption: 静的/動的)。 |
vtbl 14 HRESULT CmdLoadFromObject(LPWSTR ClassId, LPWSTR GrammarName, SpeechLoadOption LoadOption)
| ClassId | LPWSTR | in | 文法を提供するCOMオブジェクトのクラスID(ProgIDまたはCLSID)。 |
| GrammarName | LPWSTR | in | ロードする文法の名前。 |
| LoadOption | SpeechLoadOption | in | 読み込み方法(SpeechLoadOption: 静的/動的)。 |
vtbl 15 HRESULT CmdLoadFromResource(INT hModule, VARIANT ResourceName, VARIANT ResourceType, INT LanguageId, SpeechLoadOption LoadOption)
| hModule | INT | in | リソースを含むモジュールのハンドル(整数)。 |
| ResourceName | VARIANT | in | リソース名を保持するVARIANT。 |
| ResourceType | VARIANT | in | リソース種別を保持するVARIANT。 |
| LanguageId | INT | in | リソースの言語ID(LCID)。 |
| LoadOption | SpeechLoadOption | in | 読み込み方法(SpeechLoadOption: 静的/動的)。 |
vtbl 16 HRESULT CmdLoadFromMemory(VARIANT GrammarData, SpeechLoadOption LoadOption)
| GrammarData | VARIANT | in | メモリ上の文法バイナリを保持するVARIANT。 |
| LoadOption | SpeechLoadOption | in | 読み込み方法(SpeechLoadOption: 静的/動的)。 |
vtbl 17 HRESULT CmdLoadFromProprietaryGrammar(LPWSTR ProprietaryGuid, LPWSTR ProprietaryString, VARIANT ProprietaryData, SpeechLoadOption LoadOption)
| ProprietaryGuid | LPWSTR | in | 独自文法エンジンを識別するGUID文字列。 |
| ProprietaryString | LPWSTR | in | 独自文法エンジンへ渡す文字列パラメータ。 |
| ProprietaryData | VARIANT | in | 独自文法エンジンへ渡すバイナリデータを保持するVARIANT。 |
| LoadOption | SpeechLoadOption | in | 読み込み方法(SpeechLoadOption: 静的/動的)。 |
vtbl 18 HRESULT CmdSetRuleState(LPWSTR Name, SpeechRuleState State)
| Name | LPWSTR | in | 状態を変更するルールの名前。 |
| State | SpeechRuleState | in | ルールの状態(SpeechRuleState: 有効/無効)を設定する。 |
vtbl 19 HRESULT CmdSetRuleIdState(INT RuleId, SpeechRuleState State)
| RuleId | INT | in | 状態を変更するルールの数値ID。 |
| State | SpeechRuleState | in | ルールの状態(SpeechRuleState: 有効/無効)を設定する。 |
vtbl 20 HRESULT DictationLoad(LPWSTR TopicName, SpeechLoadOption LoadOption)
| TopicName | LPWSTR | in | 読み込むディクテーショントピック名。NULLで既定トピック。 |
| LoadOption | SpeechLoadOption | in | 読み込み方法(SpeechLoadOption: 静的/動的)。 |
vtbl 21 HRESULT DictationUnload()
vtbl 22 HRESULT DictationSetState(SpeechRuleState State)
| State | SpeechRuleState | in | ディクテーション文法の状態(SpeechRuleState: 有効/無効)を設定する。 |
vtbl 23 HRESULT SetWordSequenceData(LPWSTR Text, INT TextLength, ISpeechTextSelectionInformation* Info)
| Text | LPWSTR | in | テキストバッファ機能で参照する語句データ(現在の文書内容等)。 |
| TextLength | INT | in | Textの文字数。 |
| Info | ISpeechTextSelectionInformation* | inoptional | テキスト選択情報(ISpeechTextSelectionInformation)。 |
vtbl 24 HRESULT SetTextSelection(ISpeechTextSelectionInformation* Info)
| Info | ISpeechTextSelectionInformation* | inoptional | 現在のテキスト選択範囲・カーソル位置情報(ISpeechTextSelectionInformation)。 |
vtbl 25 HRESULT IsPronounceable(LPWSTR Word, SpeechWordPronounceable* WordPronounceable)
| Word | LPWSTR | in | 発音可能か判定する単語文字列。 |
| WordPronounceable | SpeechWordPronounceable* | 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 不要)。#define global IID_ISpeechRecoGrammar "{B6D6F79F-2158-4E50-B5BC-9A9CCD852A09}" #usecom global ISpeechRecoGrammar IID_ISpeechRecoGrammar "{}" #comfunc global ISpeechRecoGrammar_get_Id 7 sptr #comfunc global ISpeechRecoGrammar_get_RecoContext 8 sptr #comfunc global ISpeechRecoGrammar_put_State 9 int #comfunc global ISpeechRecoGrammar_get_State 10 sptr #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,sptr ; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。 ; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。 ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。 ; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。 ; ※IDispatch 実装。HSP では comobj 経由でメソッド名による呼び出しも可能(vtbl 不要)。