Article View: borland.public.cppbuilder.nativeapi
Article #985Re: Startup help with SAPI
From: Michael Harris
Date: Fri, 23 Nov 2007 20:56
Date: Fri, 23 Nov 2007 20:56
38 lines
1982 bytes
1982 bytes
Easy enough using COM interfaces...
sample program.
ISpeechVoicePtr VoicePtr;
ISpeechFileStreamPtr FileStream ;
WideString wsFile = "sample.wav";
SpeechVoiceSpeakFlags eSpeechVoiceSpeakFlags = SVSFDefault;
VoicePtr = CoSpVoice::Create();
FileStream = CoSpFileStream::Create();
if(FileStream->Open( wsFile, SSFMCreateForWrite, VARIANT_FALSE) == S_OK)
{ Label1->Caption = "file output ready...";
}
if(VoicePtr->_set_AudioOutputStream(FileStream) == S_OK)
{ Label2->Caption = "Using file output";
}
VoicePtr->Speak(WideString(Edit1->Text), eSpeechVoiceSpeakFlags);
FileStream->Close()
dumps 'sample.wav' at local dir.
--
Michael
> "Marc" > wrote in message
>>
>> This could be an idea...
>> Did you succeed in implementing a SpeakToFile solution? Where a WAV file
>> is created rather than the text read through the loud speaker?
>>
>> Rds
>> Marc
>
>
Technical Details
Message-ID:
<47473e5e$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<473ebe39$1@newsgroups.borland.com> <47441606$1@newsgroups.borland.com> <4744194b$1@newsgroups.borland.com> <474420da$1@newsgroups.borland.com> <474428ad$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> <47441606$1@newsgroups.borland.com> <4744194b$1@newsgroups.borland.com> <474420da$1@newsgroups.borland.com> <474428ad$1@newsgroups.borland.com> Subject: Re: Startup help with SAPI Date: Fri, 23 Nov 2007 14:56:00 -0600 Lines: 40 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: <47473e5e$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1195851358 76.187.54.201 (23 Nov 2007 12:55:58 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail