Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Microsoft Speech API (String to Voice)
09-25-2009, 06:33 AM
Post: #1
Microsoft Speech API (String to Voice)
This is tut that describes how to use Microsoft Speech API in Delphi application.
This option is enabled for a long time, and it is pretty simple to use it !
I used this function when you Enter with mouse in one of labels in this program : http://www.pro9ramming.com/file-info-by-...t-274.html
Okay, let's start, first of all, you need to register library, in "uses" :
Code:
uses Comobj;
Now after we registered or lib, we need to make a procedure for speech :
Code:
procedure speak(s:string);
var
  voice: OLEVariant;
begin
  voice := CreateOLEObject('SAPI.SpVoice');
  voice.Speak(s, 0);
end;
As you can see you have in argument "s" and out is voice !
Now you just need to call that procedure, let's say you have a button and edit in which is string you need your program to say :
Code:
procedure TForm1.Button1Click(Sender: TObject);
begin
  speak(edit1.text);
end;
That's all, you have attachment with source and exe file, so you can play with it and include it in your programs.
P.S. It is silly how it telly "bad" words . . .


Attached File(s)
.zip  microsoft_speech_api_source.zip (Size: 209.23 KB / Downloads: 1)

"I dont know with what weapons World War 3 will be fought with, but i know World War 4 will be fought with stones and sticks" - Albert Einstein
Visit this user's website Find all posts by this user
Quote this message in a reply
11-19-2009, 04:05 PM
Post: #2
RE: Microsoft Speech API (String to Voice)
intresting dont know about this

thakns for share dude +1
Find all posts by this user
Quote this message in a reply
11-19-2009, 08:10 PM
Post: #3
RE: Microsoft Speech API (String to Voice)
(11-19-2009 04:05 PM)kcscm Wrote:  intresting dont know about this

thakns for share dude +1
Well that is the least i can do !

"I dont know with what weapons World War 3 will be fought with, but i know World War 4 will be fought with stones and sticks" - Albert Einstein
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


 Quick Theme: