android - speech recognizer delphi XE5 -
i find trip "android text speech jni translation" in forum. want convert speech text, same "voice recognize" . , have few code below:
{ tform1.trecognitionlistener } constructor tform1.trecognitionlistener.create(aparent: tform1); begin inherited create; fparent := aparent; end; procedure tform1.buttoninitspeechclick(sender: tobject); var b : boolean; begin b := tjspeechrecognizer.javaclass.isrecognitionavailable(sharedactivitycontext); if b begin speechrecognizer := tjspeechrecognizer.javaclass.createspeechrecognizer(sharedactivitycontext); reclistener := trecognitionlistener.create(self); recognizerintent := tjrecognizerintent.javaclass.getvoicedetailsintent(sharedactivitycontext); recognizerintent.putextra(tjrecognizerintent.javaclass.extra_language_model, stringtojstring('en-us')); speechrecognizer.setrecognitionlistener(reclistener); end; end;
it have bug :"speechrecognize should used application's main thead" that's all; plz tell me reason?, and, how fix it.
Comments
Post a Comment