Article View: borland.public.cppbuilder.nativeapi
Article #974Re: BCB and SAPI v5
From: Marc
Date: Thu, 22 Nov 2007 22:26
Date: Thu, 22 Nov 2007 22:26
65 lines
2797 bytes
2797 bytes
Hi Remy
>> You need to use the IID of the interface, not its CLSID
I did that (See my post 19:52)
>>
Did you verify that FormatId() is not returning GUID_NULL and
WaveFormatExPtr() is not returning NULL?
<<
cAudioFmt.FormatId() = {3487517280, 28668, 4561, "�F\0 �Zj\\"}
cAudioFmt.WaveFormatExPtr() points to a tWAVEFORMATEX with the values
wFormatTag =1
nChannels=2
nSamplesPerSec=22050
nAvgBytesPerSec=88200
nBlockAlign=4;
wBitsPerSample=16;
cbSize=0;
If I understand the MS description (
http://msdn2.microsoft.com/en-us/library/ms717492.aspx)
correctly then cAudioFmt.FormatId() is actualy the value of
SPDFID_WaveFormatEx and the WaveFormatExPtr is a complete description of the
voice channel.
Therefore I tried to make the call as
hr = SPBindToFile(L"c:\\test.wav", SPFM_CREATE_ALWAYS, &cpStream,
&SPDFID_WaveFormatEx, &MyAudioFmt);
where MyAudioFmt is a tWAVEFORMATEX structure filled with the above values.
Still the same error.
The SPDFID_WaveFormatEx is actually a value I had to define in my code as it
was declared as EXTERN_C in sapi.h.
I just put some bogus values there, may this be the reason ?
What is the right value to initialize SPDFID_WaveFormatEx ?
Rds
Marc
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> schrieb im Newsbeitrag
news:4745eb5c$1@newsgroups.borland.com...
>
> "Marc" <info@mawnet.com> wrote in message
> news:47457331@newsgroups.borland.com...
>
>> I replaced it with
> <snip>
>
> That is not the correct replacement. You need to use the IID of the
> interface, not its CLSID, ie:
>
> HRESULT hr = ::CoCreateInstance(CLSID_SpStream, NULL, CLSCTX_ALL,
> IID_ISpStream, (void **)ppStream);
>
>
> Gambit
>
>
Technical Details
Message-ID:
<4746024a@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<47446f75$1@newsgroups.borland.com> <47449cae@newsgroups.borland.com> <4744a4e3$1@newsgroups.borland.com> <4744b412$1@newsgroups.borland.com> <474564ea$1@newsgroups.borland.com> <47457331@newsgroups.borland.com> <4745eb5c$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 Reply-To: "Marc" <info@mawnet.com> From: "Marc" <info@mawnet.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <47446f75$1@newsgroups.borland.com> <47449cae@newsgroups.borland.com> <4744a4e3$1@newsgroups.borland.com> <4744b412$1@newsgroups.borland.com> <474564ea$1@newsgroups.borland.com> <47457331@newsgroups.borland.com> <4745eb5c$1@newsgroups.borland.com> Subject: Re: BCB and SAPI v5 Date: Thu, 22 Nov 2007 23:26:13 +0100 Lines: 67 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; Original NNTP-Posting-Host: 83.76.36.137 Message-ID: <4746024a@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1195770442 83.76.36.137 (22 Nov 2007 14:27:22 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail