Speaking Text

Please discuss general Delphi programming topics here.

Speaking Text

Postby Blod » July 20th, 2011, 6:11 pm

Hi,

I came upon this code example when actually looking for something else.


Let the computer speak! (Microsoft Voice API)
- Add a Button and Edit box
- Add this uses statement: uses Comobj;
- Add this coding for the button (the program will read the contents of Edit1):

procedure TForm1.Button1Click(Sender: TObject);
var
CompVoice : OLEVariant;
sText : String;
begin
sText := Edit1.Text;
CompVoice := CreateOLEObject('SAPI.SpVoice');
CompVoice.Speak(sText, 0);
end;

It works on Memos as well as edits and speaks out the text contained in these controls.
What I'd like to know is whether there is anyway of controlling the speed of the speaking voice etc?

Thanks

Blod
Blod
Junior Member
Junior Member
 
Posts: 33
Joined: June 5th, 2008, 12:54 pm

Re: Speaking Text

Postby geowink » July 20th, 2011, 8:22 pm

And is there a way to change the voice itself? Female, Southern, etc.

George
George
geowink
Junior Member
Junior Member
 
Posts: 37
Joined: November 29th, 2005, 3:59 am
Location: La Grange, Illinois

Re: Speaking Text

Postby Kambiz » July 21st, 2011, 1:41 am

All speaking parameters are configurable.
Here is the link to SpVoice interface: http://msdn.microsoft.com/en-us/library/ms723602%28v=vs.85%29.aspx
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2430
Joined: March 7th, 2003, 7:10 pm

Re: Speaking Text

Postby Blod » July 21st, 2011, 7:31 am

Thanks for that

Blod
Blod
Junior Member
Junior Member
 
Posts: 33
Joined: June 5th, 2008, 12:54 pm

Re: Speaking Text

Postby Blod » July 25th, 2011, 1:44 pm

Hi,

Regarding my post on speech code for use with Delphi.

It works fine in my Delphi 5 IDE but not as an executable.

I googled it and found that somebody else had the same problem.

He reported that it worked in the IDE and also as an executable in XP but not in Vista.
How can Microsoft have files to support it in XP but not in Vista which replaced XP ?
Are they trying to wind us up? (g)

Any solutions gratefully received.

Blod
Blod
Junior Member
Junior Member
 
Posts: 33
Joined: June 5th, 2008, 12:54 pm

Re: Speaking Text

Postby Blod » July 28th, 2011, 5:24 pm

Hi,

Further on this subject

Somebody had kindly but erroneously advised downloading and installing

Speechsdk51.exe at 67mb from the Microsoft' Website.
When I downloaded and installed Speechdsk51msm.exe at 131mb I was able

to run the program as an executable in Vista.
That said I can hardly ask my Vista using users to download and install a 131mb file just to use my 400k program.
I don't know if Microsoft has a motto, perhaps I can suggest "Why be Helpful?"

Blod
Blod
Junior Member
Junior Member
 
Posts: 33
Joined: June 5th, 2008, 12:54 pm


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 3 guests

cron