ホーム › Media.Speech › ISpeechRecognizer
ISpeechRecognizer
COMIDispatch (デュアル)✅ IDispatch を実装(デュアルインターフェース)。HSP では
comobj 経由でメソッド名による遅延バインド呼び出しができます(vtableインデックス不要)。メソッド 26
vtbl = vtable インデックス(0始まり)。IDispatch 実装のため HSP ではメソッド名でも呼べます(上記)。低レベルの index 呼び出し用に vtbl も掲載。0〜2 は IUnknown。
vtbl 7 HRESULT putref_Recognizer(ISpeechObjectToken* Recognizer)
| Recognizer | ISpeechObjectToken* | inoptional | 使用する認識エンジンを表すオブジェクトトークン。 |
vtbl 8 HRESULT get_Recognizer(ISpeechObjectToken** Recognizer)
| Recognizer | ISpeechObjectToken** | out | 現在の認識エンジンを表すオブジェクトトークンを受け取るポインタ。 |
vtbl 9 HRESULT put_AllowAudioInputFormatChangesOnNextSet(VARIANT_BOOL Allow)
| Allow | VARIANT_BOOL | in | 次回入力設定時にエンジンへ合わせたフォーマット変更を許可するか。VARIANT_TRUEで許可。 |
vtbl 10 HRESULT get_AllowAudioInputFormatChangesOnNextSet(VARIANT_BOOL* Allow)
| Allow | VARIANT_BOOL* | out | 入力フォーマット自動変更が許可されているかを受け取るポインタ。 |
vtbl 11 HRESULT putref_AudioInput(ISpeechObjectToken* AudioInput)
| AudioInput | ISpeechObjectToken* | inoptional | 使用する入力オーディオデバイスのトークン。NULLで既定。 |
vtbl 12 HRESULT get_AudioInput(ISpeechObjectToken** AudioInput)
| AudioInput | ISpeechObjectToken** | out | 現在の入力オーディオデバイスのトークンを受け取るポインタ。 |
vtbl 13 HRESULT putref_AudioInputStream(ISpeechBaseStream* AudioInputStream)
| AudioInputStream | ISpeechBaseStream* | inoptional | 認識への入力とするストリーム(ISpeechBaseStream)。 |
vtbl 14 HRESULT get_AudioInputStream(ISpeechBaseStream** AudioInputStream)
| AudioInputStream | ISpeechBaseStream** | out | 現在の入力ストリーム(ISpeechBaseStream)を受け取るポインタ。 |
vtbl 15 HRESULT get_IsShared(VARIANT_BOOL* Shared)
| Shared | VARIANT_BOOL* | out | 共有認識エンジン(InProc非専有)であるかを受け取るVARIANT_BOOLポインタ。 |
vtbl 16 HRESULT put_State(SpeechRecognizerState State)
| State | SpeechRecognizerState | in | 認識エンジンの状態(SpeechRecognizerState: アクティブ/非アクティブ)を設定する。 |
vtbl 17 HRESULT get_State(SpeechRecognizerState* State)
| State | SpeechRecognizerState* | out | 認識エンジンの現在状態(SpeechRecognizerState)を受け取るポインタ。 |
vtbl 18 HRESULT get_Status(ISpeechRecognizerStatus** Status)
| Status | ISpeechRecognizerStatus** | out | 認識エンジンの稼働状況(ISpeechRecognizerStatus)を受け取るポインタ。 |
vtbl 19 HRESULT putref_Profile(ISpeechObjectToken* Profile)
| Profile | ISpeechObjectToken* | inoptional | 使用する認識プロファイル(話者プロファイル)のトークン。 |
vtbl 20 HRESULT get_Profile(ISpeechObjectToken** Profile)
| Profile | ISpeechObjectToken** | out | 現在の認識プロファイルのトークンを受け取るポインタ。 |
vtbl 21 HRESULT EmulateRecognition(VARIANT TextElements, VARIANT* ElementDisplayAttributes, INT LanguageId)
| TextElements | VARIANT | in | 認識をエミュレートする語句を保持するVARIANT(文字列または配列)。 |
| ElementDisplayAttributes | VARIANT* | in | 各要素の表示属性を保持するVARIANTポインタ。NULL可。 |
| LanguageId | INT | in | エミュレートに用いる言語ID(LCID)。 |
vtbl 22 HRESULT CreateRecoContext(ISpeechRecoContext** NewContext)
| NewContext | ISpeechRecoContext** | out | 新規作成した認識コンテキスト(ISpeechRecoContext)を受け取るポインタ。 |
vtbl 23 HRESULT GetFormat(SpeechFormatType Type, ISpeechAudioFormat** Format)
| Type | SpeechFormatType | in | 取得するフォーマット種別(SpeechFormatType: 入力/SREngine)。 |
| Format | ISpeechAudioFormat** | out | 取得したオーディオフォーマット(ISpeechAudioFormat)を受け取るポインタ。 |
vtbl 24 HRESULT SetPropertyNumber(LPWSTR Name, INT Value, VARIANT_BOOL* Supported)
| Name | LPWSTR | in | 設定する数値プロパティの名前。 |
| Value | INT | in | 設定する整数値。 |
| Supported | VARIANT_BOOL* | out | そのプロパティがサポートされ設定できたかを受け取るVARIANT_BOOLポインタ。 |
vtbl 25 HRESULT GetPropertyNumber(LPWSTR Name, INT* Value, VARIANT_BOOL* Supported)
| Name | LPWSTR | in | 取得する数値プロパティの名前。 |
| Value | INT* | inout | 取得した整数値を受け取るポインタ。 |
| Supported | VARIANT_BOOL* | out | そのプロパティがサポートされるかを受け取るVARIANT_BOOLポインタ。 |
vtbl 26 HRESULT SetPropertyString(LPWSTR Name, LPWSTR Value, VARIANT_BOOL* Supported)
| Name | LPWSTR | in | 設定する文字列プロパティの名前。 |
| Value | LPWSTR | in | 設定する文字列値。 |
| Supported | VARIANT_BOOL* | out | そのプロパティがサポートされ設定できたかを受け取るVARIANT_BOOLポインタ。 |
vtbl 27 HRESULT GetPropertyString(LPWSTR Name, LPWSTR* Value, VARIANT_BOOL* Supported)
| Name | LPWSTR | in | 取得する文字列プロパティの名前。 |
| Value | LPWSTR* | inout | 取得した文字列値を受け取るポインタ。 |
| Supported | VARIANT_BOOL* | out | そのプロパティがサポートされるかを受け取るVARIANT_BOOLポインタ。 |
vtbl 28 HRESULT IsUISupported(LPWSTR TypeOfUI, VARIANT* ExtraData, VARIANT_BOOL* Supported)
| TypeOfUI | LPWSTR | in | 問い合わせるUI種別を示す文字列。 |
| ExtraData | VARIANT* | in | UIへ渡す追加データのVARIANTポインタ。 |
| Supported | VARIANT_BOOL* | out | 指定UIがサポートされるかを受け取るVARIANT_BOOLポインタ。 |
| hWndParent | INT | in | UIダイアログの親ウィンドウハンドル(整数)。 |
| Title | LPWSTR | in | UIダイアログのタイトル文字列。 |
| TypeOfUI | LPWSTR | in | 表示するUI種別を示す文字列。 |
| ExtraData | VARIANT* | in | UIへ渡す追加データのVARIANTポインタ。 |
vtbl 30 HRESULT GetRecognizers(LPWSTR RequiredAttributes, LPWSTR OptionalAttributes, ISpeechObjectTokens** ObjectTokens)
| RequiredAttributes | LPWSTR | in | 必須属性の条件式。合致する認識エンジンのみ列挙する。NULL可。 |
| OptionalAttributes | LPWSTR | in | 任意属性の条件式。NULL可。 |
| ObjectTokens | ISpeechObjectTokens** | out | 条件に合致した認識エンジントークン集合を受け取るポインタ。 |
vtbl 31 HRESULT GetAudioInputs(LPWSTR RequiredAttributes, LPWSTR OptionalAttributes, ISpeechObjectTokens** ObjectTokens)
| RequiredAttributes | LPWSTR | in | 必須属性の条件式。合致する入力デバイスのみ列挙する。NULL可。 |
| OptionalAttributes | LPWSTR | in | 任意属性の条件式。NULL可。 |
| ObjectTokens | ISpeechObjectTokens** | out | 条件に合致した入力デバイストークン集合を受け取るポインタ。 |
vtbl 32 HRESULT GetProfiles(LPWSTR RequiredAttributes, LPWSTR OptionalAttributes, ISpeechObjectTokens** ObjectTokens)
| RequiredAttributes | LPWSTR | in | 必須属性の条件式。合致するプロファイルのみ列挙する。NULL可。 |
| OptionalAttributes | LPWSTR | in | 任意属性の条件式。NULL可。 |
| ObjectTokens | ISpeechObjectTokens** | out | 条件に合致したプロファイルトークン集合を受け取るポインタ。 |
HSP用 COM定義
#usecom / #comfunc によるHSPのCOM呼び出し定義。数字は vtbl インデックス(0始まり)。クラスIDが無い場合 #usecom の末尾は "{}"、ある場合は "{CLSID}"。
出力引数:
#define global IID_ISpeechRecognizer "{2D5F1C0C-BD75-4B08-9478-3B11FEA2586C}" #usecom global ISpeechRecognizer IID_ISpeechRecognizer "{}" #comfunc global ISpeechRecognizer_putref_Recognizer 7 sptr #comfunc global ISpeechRecognizer_get_Recognizer 8 sptr #comfunc global ISpeechRecognizer_put_AllowAudioInputFormatChangesOnNextSet 9 int #comfunc global ISpeechRecognizer_get_AllowAudioInputFormatChangesOnNextSet 10 var #comfunc global ISpeechRecognizer_putref_AudioInput 11 sptr #comfunc global ISpeechRecognizer_get_AudioInput 12 sptr #comfunc global ISpeechRecognizer_putref_AudioInputStream 13 sptr #comfunc global ISpeechRecognizer_get_AudioInputStream 14 sptr #comfunc global ISpeechRecognizer_get_IsShared 15 var #comfunc global ISpeechRecognizer_put_State 16 int #comfunc global ISpeechRecognizer_get_State 17 var #comfunc global ISpeechRecognizer_get_Status 18 sptr #comfunc global ISpeechRecognizer_putref_Profile 19 sptr #comfunc global ISpeechRecognizer_get_Profile 20 sptr #comfunc global ISpeechRecognizer_EmulateRecognition 21 int,var,int #comfunc global ISpeechRecognizer_CreateRecoContext 22 sptr #comfunc global ISpeechRecognizer_GetFormat 23 int,sptr #comfunc global ISpeechRecognizer_SetPropertyNumber 24 wstr,int,var #comfunc global ISpeechRecognizer_GetPropertyNumber 25 wstr,var,var #comfunc global ISpeechRecognizer_SetPropertyString 26 wstr,wstr,var #comfunc global ISpeechRecognizer_GetPropertyString 27 wstr,var,var #comfunc global ISpeechRecognizer_IsUISupported 28 wstr,var,var #comfunc global ISpeechRecognizer_DisplayUI 29 int,wstr,wstr,var #comfunc global ISpeechRecognizer_GetRecognizers 30 wstr,wstr,sptr #comfunc global ISpeechRecognizer_GetAudioInputs 31 wstr,wstr,sptr #comfunc global ISpeechRecognizer_GetProfiles 32 wstr,wstr,sptr ; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。 ; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。 ; ※出力/バッファ引数は var(変数直渡し)。varptr 方式にも切替可。 ; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。 ; ※IDispatch 実装。HSP では comobj 経由でメソッド名による呼び出しも可能(vtbl 不要)。#define global IID_ISpeechRecognizer "{2D5F1C0C-BD75-4B08-9478-3B11FEA2586C}" #usecom global ISpeechRecognizer IID_ISpeechRecognizer "{}" #comfunc global ISpeechRecognizer_putref_Recognizer 7 sptr #comfunc global ISpeechRecognizer_get_Recognizer 8 sptr #comfunc global ISpeechRecognizer_put_AllowAudioInputFormatChangesOnNextSet 9 int #comfunc global ISpeechRecognizer_get_AllowAudioInputFormatChangesOnNextSet 10 sptr #comfunc global ISpeechRecognizer_putref_AudioInput 11 sptr #comfunc global ISpeechRecognizer_get_AudioInput 12 sptr #comfunc global ISpeechRecognizer_putref_AudioInputStream 13 sptr #comfunc global ISpeechRecognizer_get_AudioInputStream 14 sptr #comfunc global ISpeechRecognizer_get_IsShared 15 sptr #comfunc global ISpeechRecognizer_put_State 16 int #comfunc global ISpeechRecognizer_get_State 17 sptr #comfunc global ISpeechRecognizer_get_Status 18 sptr #comfunc global ISpeechRecognizer_putref_Profile 19 sptr #comfunc global ISpeechRecognizer_get_Profile 20 sptr #comfunc global ISpeechRecognizer_EmulateRecognition 21 int,sptr,int #comfunc global ISpeechRecognizer_CreateRecoContext 22 sptr #comfunc global ISpeechRecognizer_GetFormat 23 int,sptr #comfunc global ISpeechRecognizer_SetPropertyNumber 24 wstr,int,sptr #comfunc global ISpeechRecognizer_GetPropertyNumber 25 wstr,sptr,sptr #comfunc global ISpeechRecognizer_SetPropertyString 26 wstr,wstr,sptr #comfunc global ISpeechRecognizer_GetPropertyString 27 wstr,sptr,sptr #comfunc global ISpeechRecognizer_IsUISupported 28 wstr,sptr,sptr #comfunc global ISpeechRecognizer_DisplayUI 29 int,wstr,wstr,sptr #comfunc global ISpeechRecognizer_GetRecognizers 30 wstr,wstr,sptr #comfunc global ISpeechRecognizer_GetAudioInputs 31 wstr,wstr,sptr #comfunc global ISpeechRecognizer_GetProfiles 32 wstr,wstr,sptr ; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。 ; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。 ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。 ; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。 ; ※IDispatch 実装。HSP では comobj 経由でメソッド名による呼び出しも可能(vtbl 不要)。