Article View: borland.public.cppbuilder.nativeapi
Article #953Re: BCB and SAPI v5
From: Remy Lebeau (TeamB)
Date: Wed, 21 Nov 2007 21:00
Date: Wed, 21 Nov 2007 21:00
37 lines
2169 bytes
2169 bytes
"Marc" <info@mawnet.com> wrote in message news:47446f75$1@newsgroups.borland.com... > When I include the "sphelper.h" needed for the SPBindToFile function, > I get plenty of errors in the *.h files. Such as? Please provide the actual errors, and the conditions you do to reproduce them. > Now I used the attached code and tried to write the TTS to a file. > > Unfortunately it fails every time with the call to SPBindToFile > (Error = E_INVALIDARG). That is because you really are passing invalid parameters to SPBindToFile(). > Has anyone ever successfully used SAPI v5 with BCB6 Yes. > CSpStreamFormat *cAudioFmt; <snip> > hr = cAudioFmt.AssignFormat(SPSF_22kHz16BitMono); cAudioFmt is declared as a pointer. You need to use the '->' operator to access it. Also, you are not assigning anything to the pointer before trying to use it. > hr = SPBindToFile( L"c:\\ttstemp.wav", SPFM_CREATE_ALWAYS, > &cpStream, & cAudioFmt.FormatId(),cAudioFmt.WaveFormatExPtr() ); cpStream and cAudioFmt are still unintialized when passed in as input. You need to assign NULL to cpStream, and allocate something for cAudioFmt. Gambit
Technical Details
Message-ID:
<47449cae@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<47446f75$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,67677465280073fd X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <47446f75$1@newsgroups.borland.com> Subject: Re: BCB and SAPI v5 Date: Wed, 21 Nov 2007 13:00:28 -0800 Lines: 39 Organization: Lebeau Software 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: 207.178.157.90 Message-ID: <47449cae@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1195678894 207.178.157.90 (21 Nov 2007 13:01:34 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail