Sample grabber
I'm using the Sample Grabber to get audio samples decoded by the graph.
The sample grabber is then connected to the NullRenderer.
It works fine on stereo files, but on 6channels-files it downmixes them, and i need all the channels for my application.
Then I tried to set theWAVEFORMATEXTENSIBLEstructure, as i found on the Microsoft website.
WAVEFORMATPCMEX waveFormatPCMEx;
waveFormatPCMEx.Format.cbSize = 22;
waveFormatPCMEx.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
waveFormatPCMEx.Format.nChannels = 6;
waveFormatPCMEx.Format.nSamplesPerSec = 48000L;
waveFormatPCMEx.Format.nAvgBytesPerSec = 864000L; // Compute using nBlkAlign * nSamp/Sec
waveFormatPCMEx.Format.nBlockAlign = 18;
waveFormatPCMEx.Format.wBitsPerSample = 24; //Container has 3 bytes
waveFormatPCMEx.Format.cbSize = 22;
waveFormatPCMEx.Samples.wValidBitsPerSample = 20; // Top 20 bits have
data
waveFormatPCMEx.dwChannelMask = KSAUDIO_SPEAKER_5POINT1;
waveFormatPCMEx.SubFormat = KSDATAFORMAT_SUBTYPE_PCM; // Specify PCM
HRESULT hr = CreateAudioMediaType((LPWAVEFORMATEX)&waveFormatPCMEx,&mt, TRUE);
But the graph fails to (intelligent) connect the sample grabber to the
File Source, withVFW_E_CANNOT_CONNECT.
Should i set the sample grabber in some different way? Any idea?
Thanks in advance!
