Re: ASF Writer with WAVEFORMATEXTENSIBLE



Jonathan Benedicto wrote:

Hello All,

How can I use WAVEFORMATEXTENSIBLE with the WM ASF
Writer? I setup my AM_MEDIA_TYPE like this:

pmt.majortype := MEDIATYPE_Audio;
pmt.subtype := MEDIASUBTYPE_PCM;
pmt.bFixedSizeSamples := true;
pmt.bTemporalCompression := false;
pmt.lSampleSize := 1;
pmt.formattype := FORMAT_WaveFormatEx;
pmt.pUnk := NULL;
pmt.cbFormat := sizeof( WAVEFORMATEX ) +
pwfx.Format.cbSize; ...

where pmt is a AM_MEDIA_TYPE structure and pwfx is a
WAVEFORMATEXTENSIBLE structure, and set the profile to
use the Windows Media Audio Professional codec, but I get
a 0x80040217 error when I try to connect the audio source
to the writer.

HRESULT: 0x80040217 (2147746327)
Name: VFW_E_CANNOT_CONNECT
Description: No combination of intermediate filters could be
found to make the connection.

I can't tell you for sure, but what comes to my mind is that
the subtype should match the wFormatTag and yours isn't. If
your pwfx points to a WAVEFORMATEXTENSIBLE, then wFormatTag
should be WAVE_FORMAT_EXTENSIBLE while MEDIASUBTYPE_PCM
matches WAVE_FORMAT_PCM. That is, MEDIASUBTYPE_PCM is the
same as FOURCCMap(WAVE_FORMAT_PCM) when you'd need
FOURCCMap(WAVE_FORMAT_EXTENSIBLE).

A FOURCCMap() is just a GUID where the GUID::dwData1 field
is the same as the wFormatTag value and the rest has a fixed
value (see
http://msdn.microsoft.com/library/en-us/directshow/htm/audiosubtypes.asp).



--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// a dot angeli at psynet dot net
// http://www.riseoftheants.com/mmx/faq.htm


.



Relevant Pages

  • Re: USB 24-bit audio, 4 channel recording with DirectSound
    ... > When using WAVEFORMATEXTENSIBLE, ... > apply to the USB's AS Interface descriptor, ... > format for our USB audio device, the wFormatTag for the USB AS Interface ...
    (microsoft.public.win32.programmer.directx.audio)
  • Re: USB 24-bit audio, 4 channel recording with DirectSound
    ... When using WAVEFORMATEXTENSIBLE, the wFormatTag in the WAVEFORMATEX ... format for our USB audio device, the wFormatTag for the USB AS Interface ... > WAVEFORMATEXTENSIBLE format. ...
    (microsoft.public.win32.programmer.directx.audio)
  • Re: Problem With Audio Decoder DMO In DirectShow
    ... You are not reserving space for the cbSize bytes at the end ... of the WAVEFORMATEX and you are not copying them: ... // Alessandro Angeli ... // a dot angeli at psynet dot net ...
    (microsoft.public.win32.programmer.directx.audio)
  • Re: ACM & wFormatTag
    ... if i am writing a mp3 decoder in the acm driver how ... will i decode it.mp3 files dnt have a waveformat header. ... The WAVEFORMATEX structure in the AM_MEDIA_TYPE has nothing ... // a dot angeli at psynet dot net ...
    (microsoft.public.win32.programmer.directx.audio)
  • Re: ACM conversion PCM to MP3
    ... The value of nBlockSize is not always the value you used but ... it is OK when the other values of WAVEFORMATEX are the ones ... // Alessandro Angeli ... // a dot angeli at psynet dot net ...
    (microsoft.public.win32.programmer.mmedia)