ホーム › Media.Speech › ISpeechRecoContext
ISpeechRecoContext
COMIDispatch (デュアル)✅ IDispatch を実装(デュアルインターフェース)。HSP では
comobj 経由でメソッド名による遅延バインド呼び出しができます(vtableインデックス不要)。メソッド 25
vtbl = vtable インデックス(0始まり)。IDispatch 実装のため HSP ではメソッド名でも呼べます(上記)。低レベルの index 呼び出し用に vtbl も掲載。0〜2 は IUnknown。
vtbl 7 HRESULT get_Recognizer(ISpeechRecognizer** Recognizer)
| Recognizer | ISpeechRecognizer** | out | このコンテキストが属する認識エンジン(ISpeechRecognizer)を受け取るポインタ。 |
vtbl 8 HRESULT get_AudioInputInterferenceStatus(SpeechInterference* Interference)
| Interference | SpeechInterference* | out | 入力音声の妨害状態(SpeechInterference: 雑音/大小すぎ等)を受け取るポインタ。 |
| UIType | LPWSTR* | out | エンジンが要求しているUIの種別文字列を受け取るポインタ。 |
vtbl 10 HRESULT putref_Voice(ISpeechVoice* Voice)
| Voice | ISpeechVoice* | inoptional | このコンテキストで使用する音声合成オブジェクト(ISpeechVoice)。 |
vtbl 11 HRESULT get_Voice(ISpeechVoice** Voice)
| Voice | ISpeechVoice** | out | このコンテキストの音声合成オブジェクト(ISpeechVoice)を受け取るポインタ。 |
vtbl 12 HRESULT put_AllowVoiceFormatMatchingOnNextSet(VARIANT_BOOL Allow)
| Allow | VARIANT_BOOL | in | 次回設定時に音声フォーマットを入力に合わせることを許可するか。VARIANT_TRUEで許可。 |
vtbl 13 HRESULT get_AllowVoiceFormatMatchingOnNextSet(VARIANT_BOOL* pAllow)
| pAllow | VARIANT_BOOL* | out | 音声フォーマット整合が許可されているかを受け取るポインタ。 |
vtbl 14 HRESULT put_VoicePurgeEvent(SpeechRecoEvents EventInterest)
| EventInterest | SpeechRecoEvents | in | 音声出力をパージ(中断)させるトリガーとなるイベント種別(SpeechRecoEvents)を設定する。 |
vtbl 15 HRESULT get_VoicePurgeEvent(SpeechRecoEvents* EventInterest)
| EventInterest | SpeechRecoEvents* | out | 音声パージのトリガーイベント種別(SpeechRecoEvents)を受け取るポインタ。 |
vtbl 16 HRESULT put_EventInterests(SpeechRecoEvents EventInterest)
| EventInterest | SpeechRecoEvents | in | 受信対象とする認識イベント種別フラグ(SpeechRecoEvents)を設定する。 |
vtbl 17 HRESULT get_EventInterests(SpeechRecoEvents* EventInterest)
| EventInterest | SpeechRecoEvents* | out | 受信対象の認識イベント種別フラグ(SpeechRecoEvents)を受け取るポインタ。 |
| MaxAlternates | INT | in | コマンド認識で生成する代替候補の最大数を設定する。 |
| MaxAlternates | INT* | out | コマンド認識で生成する代替候補の最大数を受け取るポインタ。 |
vtbl 20 HRESULT put_State(SpeechRecoContextState State)
| State | SpeechRecoContextState | in | コンテキストの状態(SpeechRecoContextState: 有効/無効)を設定する。 |
vtbl 21 HRESULT get_State(SpeechRecoContextState* State)
| State | SpeechRecoContextState* | out | コンテキストの現在状態(SpeechRecoContextState)を受け取るポインタ。 |
vtbl 22 HRESULT put_RetainedAudio(SpeechRetainedAudioOptions Option)
| Option | SpeechRetainedAudioOptions | in | 認識音声の保持オプション(SpeechRetainedAudioOptions: 保持しない/する)を設定する。 |
vtbl 23 HRESULT get_RetainedAudio(SpeechRetainedAudioOptions* Option)
| Option | SpeechRetainedAudioOptions* | out | 認識音声の保持オプション(SpeechRetainedAudioOptions)を受け取るポインタ。 |
vtbl 24 HRESULT putref_RetainedAudioFormat(ISpeechAudioFormat* Format)
| Format | ISpeechAudioFormat* | inoptional | 保持する音声のオーディオフォーマット(ISpeechAudioFormat)を設定する。 |
vtbl 25 HRESULT get_RetainedAudioFormat(ISpeechAudioFormat** Format)
| Format | ISpeechAudioFormat** | out | 保持音声のオーディオフォーマット(ISpeechAudioFormat)を受け取るポインタ。 |
vtbl 26 HRESULT Pause()
vtbl 27 HRESULT Resume()
vtbl 28 HRESULT CreateGrammar(VARIANT GrammarId, ISpeechRecoGrammar** Grammar)
| GrammarId | VARIANT | in | 作成する文法に割り当てる任意の識別子を保持するVARIANT。 |
| Grammar | ISpeechRecoGrammar** | out | 作成した文法(ISpeechRecoGrammar)を受け取るポインタ。 |
vtbl 29 HRESULT CreateResultFromMemory(VARIANT* ResultBlock, ISpeechRecoResult** Result)
| ResultBlock | VARIANT* | in | 保存済み認識結果のバイトデータを保持するVARIANTポインタ。 |
| Result | ISpeechRecoResult** | out | 復元された認識結果(ISpeechRecoResult)を受け取るポインタ。 |
vtbl 30 HRESULT Bookmark(SpeechBookmarkOptions Options, VARIANT StreamPos, VARIANT BookmarkId)
| Options | SpeechBookmarkOptions | in | ブックマーク動作のオプション(SpeechBookmarkOptions)。 |
| StreamPos | VARIANT | in | ブックマークを設置する入力ストリーム位置を保持するVARIANT。 |
| BookmarkId | VARIANT | in | ブックマークに割り当てる識別子を保持するVARIANT。 |
| AdaptationString | LPWSTR | in | 認識精度向上のための適応用テキスト(直近の文脈語句)を設定する。 |
HSP用 COM定義
#usecom / #comfunc によるHSPのCOM呼び出し定義。数字は vtbl インデックス(0始まり)。クラスIDが無い場合 #usecom の末尾は "{}"、ある場合は "{CLSID}"。
出力引数:
#define global IID_ISpeechRecoContext "{580AA49D-7E1E-4809-B8E2-57DA806104B8}" #usecom global ISpeechRecoContext IID_ISpeechRecoContext "{}" #comfunc global ISpeechRecoContext_get_Recognizer 7 sptr #comfunc global ISpeechRecoContext_get_AudioInputInterferenceStatus 8 var #comfunc global ISpeechRecoContext_get_RequestedUIType 9 var #comfunc global ISpeechRecoContext_putref_Voice 10 sptr #comfunc global ISpeechRecoContext_get_Voice 11 sptr #comfunc global ISpeechRecoContext_put_AllowVoiceFormatMatchingOnNextSet 12 int #comfunc global ISpeechRecoContext_get_AllowVoiceFormatMatchingOnNextSet 13 var #comfunc global ISpeechRecoContext_put_VoicePurgeEvent 14 int #comfunc global ISpeechRecoContext_get_VoicePurgeEvent 15 var #comfunc global ISpeechRecoContext_put_EventInterests 16 int #comfunc global ISpeechRecoContext_get_EventInterests 17 var #comfunc global ISpeechRecoContext_put_CmdMaxAlternates 18 int #comfunc global ISpeechRecoContext_get_CmdMaxAlternates 19 var #comfunc global ISpeechRecoContext_put_State 20 int #comfunc global ISpeechRecoContext_get_State 21 var #comfunc global ISpeechRecoContext_put_RetainedAudio 22 int #comfunc global ISpeechRecoContext_get_RetainedAudio 23 var #comfunc global ISpeechRecoContext_putref_RetainedAudioFormat 24 sptr #comfunc global ISpeechRecoContext_get_RetainedAudioFormat 25 sptr #comfunc global ISpeechRecoContext_Pause 26 #comfunc global ISpeechRecoContext_Resume 27 #comfunc global ISpeechRecoContext_CreateGrammar 28 int,sptr #comfunc global ISpeechRecoContext_CreateResultFromMemory 29 var,sptr #comfunc global ISpeechRecoContext_Bookmark 30 int,int,int #comfunc global ISpeechRecoContext_SetAdaptationData 31 wstr ; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。 ; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。 ; ※出力/バッファ引数は var(変数直渡し)。varptr 方式にも切替可。 ; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。 ; ※IDispatch 実装。HSP では comobj 経由でメソッド名による呼び出しも可能(vtbl 不要)。#define global IID_ISpeechRecoContext "{580AA49D-7E1E-4809-B8E2-57DA806104B8}" #usecom global ISpeechRecoContext IID_ISpeechRecoContext "{}" #comfunc global ISpeechRecoContext_get_Recognizer 7 sptr #comfunc global ISpeechRecoContext_get_AudioInputInterferenceStatus 8 sptr #comfunc global ISpeechRecoContext_get_RequestedUIType 9 sptr #comfunc global ISpeechRecoContext_putref_Voice 10 sptr #comfunc global ISpeechRecoContext_get_Voice 11 sptr #comfunc global ISpeechRecoContext_put_AllowVoiceFormatMatchingOnNextSet 12 int #comfunc global ISpeechRecoContext_get_AllowVoiceFormatMatchingOnNextSet 13 sptr #comfunc global ISpeechRecoContext_put_VoicePurgeEvent 14 int #comfunc global ISpeechRecoContext_get_VoicePurgeEvent 15 sptr #comfunc global ISpeechRecoContext_put_EventInterests 16 int #comfunc global ISpeechRecoContext_get_EventInterests 17 sptr #comfunc global ISpeechRecoContext_put_CmdMaxAlternates 18 int #comfunc global ISpeechRecoContext_get_CmdMaxAlternates 19 sptr #comfunc global ISpeechRecoContext_put_State 20 int #comfunc global ISpeechRecoContext_get_State 21 sptr #comfunc global ISpeechRecoContext_put_RetainedAudio 22 int #comfunc global ISpeechRecoContext_get_RetainedAudio 23 sptr #comfunc global ISpeechRecoContext_putref_RetainedAudioFormat 24 sptr #comfunc global ISpeechRecoContext_get_RetainedAudioFormat 25 sptr #comfunc global ISpeechRecoContext_Pause 26 #comfunc global ISpeechRecoContext_Resume 27 #comfunc global ISpeechRecoContext_CreateGrammar 28 int,sptr #comfunc global ISpeechRecoContext_CreateResultFromMemory 29 sptr,sptr #comfunc global ISpeechRecoContext_Bookmark 30 int,int,int #comfunc global ISpeechRecoContext_SetAdaptationData 31 wstr ; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。 ; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。 ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。 ; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。 ; ※IDispatch 実装。HSP では comobj 経由でメソッド名による呼び出しも可能(vtbl 不要)。