Recent

Author Topic: SpeechSynthesize  (Read 29684 times)

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: SpeechSynthesize
« Reply #45 on: March 18, 2014, 05:33:40 am »
ok. so Finish for the first "say" came after the second "say" was fired. Unfortunately, it doesn't seem like there's truly reliable way to say which "Finish" came in first. I wonder if OnFinish should be forced (if StopSpeech is called).
The order of calls might be logical way to track it (but there's no warranty for that)

Anyways. Here's the way to make it work (without any extra changes to speechsynthesizer.pas)
If you pressed the "say" for the second time, the device will be still "speaking" at the time OnFinish arrives. Thus it should be ignored. If it's a normal stop IsSpeaking would return false.

Code: [Select]
procedure TForm1.OnFinish(Sender: TObject);
begin
  if not sp.IsSpeaking then begin
    MenuItem3.Enabled:=True;
    MenuItem4.Enabled:=False;
  end;
end; 

Kogs, please let me know of your results.
A) It works
B) Still doesn't work exactly the way I need.
C) Something else.
« Last Edit: March 18, 2014, 05:35:45 am by skalogryz »

kogs

  • New Member
  • *
  • Posts: 42
Re: SpeechSynthesize
« Reply #46 on: March 18, 2014, 12:45:38 pm »
A) It works

speechsynthesize.pas -> speechsynthesizer.pas

testSpeech4
       |
      \/

ok, ok, ok

kogs
(Aphasia - http://en.wikipedia.org/wiki/Aphasia)
Mac OS X 10.9.1

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: SpeechSynthesize
« Reply #47 on: March 18, 2014, 01:05:39 pm »
Beautiful! I guess now you can finish your application.

kogs

  • New Member
  • *
  • Posts: 42
Re: SpeechSynthesize
« Reply #48 on: March 18, 2014, 01:50:55 pm »
...speech synthesis: speechsynthesize.pas: ->...speech synthesis: speechsynthesizer.pas:

"unit1.pas" ->  ...
    Memo1: TMemo;
    MenuItemEdit: TMenuItem;
    MenuItemEditSpeech: TMenuItem;
    MenuItemEditSpeechStart: TMenuItem;
    MenuItemEditSpeechStop: TMenuItem;
   ...

ok

kogs
(Aphasia - http://en.wikipedia.org/wiki/Aphasia)
Mac OS X 10.9.1

 

TinyPortal © 2005-2018