Use of Texttospeech
Official API Address: Texttospeech
FMX downgrade with Android TTS example:
unit main;interfaceuses system.sysutils, system.types, system.uitypes, SYSTEM.CLASSES, SYSTEM.VARIANTS,  FMX. TYPES, FMX. CONTROLS, FMX. FORMS, FMX. GRAPHICS, FMX. DIALOGS, FMX. LAYOUTS,  FMX. MEMO, FMX. STDCTRLS, ANDROID.SPEECH.TTS, ANDROIDAPI.JNIBRIDGE,  FMX. SCROLLBOX, FMX. Controls.presentation;type tformmain = class (tform) buttonsay: TButton; Memo: TMemo; Switch1: TSwitch; label1: tlabel; procedure buttonsayclick (Sender: TObject); procedure formcreate (Sender: tobject); private type toninitlistener = class (TJavaLocal, Jtexttospeech_oninitlistener) private [weak] fformmain: tformmain; Public constructor create (FormMain: TFormMain); procedure oninit (Status: integer); cdecl; end; private OnInitListener: TOnInitListener; TextToSpeech: JTextToSpeech; public { Public declarations } end;var formmain: tformmain;implementationuses  ANDROIDAPI.HELPERS, FMX. helpers.android; {$R *.fmx}constructor tformmain.toninitlistener.create (formmain: tformmain);begin inherited create; fformmain := formmain;end;procedure TFormMain.TOnInitListener.onInit (Status: integer);begin if status = Tjtexttospeech_success then fformmain.buttonsay.enabled := true;end;procedure Tformmain.buttonsayclick (sender: tobject); begin if switch1.ischecked then texttospeech.setpitch (0.1) // set the tone, the greater the value the more The voice (female), the smaller the value becomes male, 1.0 is the general else texttospeech.setpitch (1.0); // set the tone, the greater the value of the voice (female), the smaller the value becomes male, 1.0 is the conventional texttospeech.speak (Stringtojstring (Memo.text), tjtexttospeech_queue_add, nil); end; Procedure tformmain.formcreate (Sender: tobject);begin oninitlistener := Toninitlistener.create (self); texttospeech := tjtexttospeech.javaclass.init ( Sharedactivitycontext, oninitlistener); End;end.
? FMX downgrade with Android TTS