I just use the speechlib.tlb file from SAPI 5.1
You can import this into delphi and then place the 
TSpSharedRecoContext onto your form. Add event handlers for the 
events you are interested in (Recognition is the most important one).

In the recognition event handler (or the hypothesis or false 
recognition handlers) you need code like this to get the important 
information:

var text: String; confidence: Integer;

text:=Result.PhraseInfo.GetText(0,-1,True);
Confidence:=Integer(Result.PhraseInfo.Rule.Confidence);


You need something like this code to set up speech recognition:

Var
  SRGrammar: ISpeechRecoGrammar;
  Rule: ISpeechGrammarRule;
  WordNumber: Integer;

  // Create this object and fill it with the words
  // or phrases you want to recognise before calling CreateGrammar
  Phrases: TStringList;

procedure AddWord(word: String);
Var Value: OleVariant;
begin
  Inc(WordNumber);
  Value:=WordNumber;
  Rule.InitialState.AddWordTransition
(Nil,word,' ',SPWT_LEXICAL,'value',1,value,1.0);
end;



procedure CreateGrammar;
begin
  //OnAudioLevel event is not fired by default - this changes that
  SpSharedRecoContext.EventInterests := SREAllEvents;
  SRGrammar := SpSharedRecoContext.CreateGrammar(0);
  Rule:=SRGrammar.Rules.Add('word',SRATopLevel+SRADefaultToActive,0);
  WordNumber:=0;
  for i:=0 to Phrases.Count-1 do begin
    AddWord(Phrases[i]);
  end;
  Rule:=Nil;
  SRGrammar.Rules.Commit;
  SRGrammar.CmdSetRuleIdState(0, SGDSActive);
end;

--- In [email protected], metin duman <[EMAIL PROTECTED]> 
wrote:
> Hi. I need a component that is used for speech
> recognation process. Could you help me about it. Can I
> find a free component and where?
> Thanks.
> 
> 
>               
> ____________________________________________________ 
> Yahoo! Sports 
> Rekindle the Rivalries. Sign up for Fantasy Football 
> http://football.fantasysports.yahoo.com




-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to