unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleServer, SpeechLib_TLB,
ActiveX;
type
TForm2 =
class(TForm)
SpSharedRecoContext1: TSpSharedRecoContext;
Memo1: TMemo;
procedure cre(Sender: TObject);
procedure SpSharedRecoContext1Hypothesis(ASender: TObject;
StreamNumber: Integer; StreamPosition: OleVariant;
const Result: ISpeechRecoResult);
procedure SpSharedRecoContext1Recognition(ASender: TObject;
StreamNumber: Integer; StreamPosition: OleVariant;
RecognitionType: TOleEnum;
const Result: ISpeechRecoResult);
private
{ Private-Deklarationen }
fMyGrammar:ISpeechRecoGrammar;
public
{ Public-Deklarationen }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.cre(Sender: TObject);
begin
fMyGrammar:=SpSharedRecoContext1.CreateGrammar(0);
fMyGrammar.DictationSetState(SGDSActive);
end;
procedure TForm2.SpSharedRecoContext1Hypothesis(ASender: TObject;
StreamNumber: Integer; StreamPosition: OleVariant;
const Result: ISpeechRecoResult);
begin
Memo1.Text := Result.PhraseInfo.GetText(0,-1,true);
end;
procedure TForm2.SpSharedRecoContext1Recognition(ASender: TObject;
StreamNumber: Integer; StreamPosition: OleVariant; RecognitionType: TOleEnum;
const Result: ISpeechRecoResult);
begin
Memo1.Text := Result.PhraseInfo.GetText(0,-1,true);
end;
end.