コード例 #1
0
        private void SetAudioDecoderOutputToPCMStereo(IBaseFilter audiodecoder)
        {
            // Set audio decoder to output 2 channel PCM  // wm/asf writer doesn't support multi-channel audio
            int       hr;
            Guid      AVDecCommonOutputFormat = new Guid(0x3c790028, 0xc0ce, 0x4256, 0xb1, 0xa2, 0x1b, 0x0f, 0xc8, 0xb1, 0xdc, 0xdc);
            ICodecAPI audioConfig             = audiodecoder as ICodecAPI;

            if (audioConfig != null)
            {
                object pValue = 0;

                hr = audioConfig.GetValue(AVDecCommonOutputFormat, out pValue);
                DsError.ThrowExceptionForHR(hr);

                hr = audioConfig.IsModifiable(AVDecCommonOutputFormat);

                if (hr == 0)
                {
                    Guid AVDecAudioOutputFormat_PCM_Stereo_Auto = new Guid(0x696e1d35, 0x548f, 0x4036, 0x82, 0x5f, 0x70, 0x26, 0xc6, 0x00, 0x11, 0xbd);
                    pValue = AVDecAudioOutputFormat_PCM_Stereo_Auto.ToString("B");
                    hr     = audioConfig.SetValue(AVDecCommonOutputFormat, ref pValue);
                    DsError.ThrowExceptionForHR(hr);
                }
            }
        }
コード例 #2
0
 public IntPtr GetValue(Guid api)
 {
     _api.GetValue(api, out var value).ThrowOnError();
     return(value);
 }