Example #1
0
 public void SetFormat(WaveFormatEx wfx)
 {
     if (wfx != null)
     {
         int cb = Marshal.SizeOf(wfx);
         IntPtr _ptr = Marshal.AllocCoTaskMem(cb);
         try
         {
             Marshal.StructureToPtr(wfx, _ptr, true);
             SetFormat(_ptr, cb);
             formatType = FormatType.WaveEx;
         }
         finally
         {
             Marshal.FreeCoTaskMem(_ptr);
         }
     }
 }
Example #2
0
 public static void SetFormat(ref AMMediaType mt, ref WaveFormatEx wfx)
 {
     if (wfx != null)
     {
         int cb = Marshal.SizeOf(wfx);
         IntPtr _ptr = Marshal.AllocCoTaskMem(cb);
         try
         {
             Marshal.StructureToPtr(wfx, _ptr, true);
             SetFormat(ref mt, _ptr, cb);
             if (mt != null)
             {
                 mt.formatType = FormatType.WaveEx;
             }
         }
         finally
         {
             Marshal.FreeCoTaskMem(_ptr);
         }
     }
 }
Example #3
0
 public WaveFormatExtensible()
 {
     Format = new WaveFormatEx();
 }