🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #1077

Re: Startup help with SAPI

#1077
From: Michael Harris
Date: Mon, 19 Nov 2007 16:49
39 lines
1918 bytes
"Marc"  wrote in message news:473ebe39$1@newsgroups.borland.com...
...
> Does someone has a simple sample in BCB that just shows how to speak a 
> number?
>
> Rds
> Marc

I went about it a little differently.
Import Type Library
// Type Lib: C:\Program Files\Common Files\Microsoft Shared\Speech\sapi.dll 
(1)
saved as \..\CBuilder5\Imports\SpeechLib_TLB.cpp

application.cpp
USEUNIT("..\..\CBuilder5\Imports\SpeechLib_TLB.cpp");

unit1.cpp
namespace { // anon

    ISpeechVoicePtr VoicePtr;
    SpeechVoiceSpeakFlags eSpeechVoiceSpeakFlags = SVSFDefault;

};

void __fastcall TfrmMain::Button1Click(TObject *Sender)
{
if (!VoicePtr)
    VoicePtr = CoSpVoice::Create();
VoicePtr->Speak(WideString("Hello world"),  eSpeechVoiceSpeakFlags);
// or
VoicePtr->Speak(WideString(Edit1->Text),  eSpeechVoiceSpeakFlags);
}

worked fine.

--
Michael
Technical Details
Message-ID: <4741be99@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feeder6.cambrium.nl!feed.tweaknews.nl!xlned.com!feeder1.xlned.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <473ebe39$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,ead936854bc3aa40
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Michael Harris" <techonos-NO-SPAM-@attbi.com>
From: "Michael Harris" <techonos-NO-SPAM-@attbi.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <473ebe39$1@newsgroups.borland.com>
Subject: Re: Startup help with SAPI
Date: Mon, 19 Nov 2007 10:49:44 -0600
Lines: 43
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 76.187.54.201
Message-ID: <4741be99@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1195490969 76.187.54.201 (19 Nov 2007 08:49:29 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feeder6.cambrium.nl!feed.tweaknews.nl!xlned.com!feeder1.xlned.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail