Exemplo n.º 1
0
 public void Open()
 {
     if (this.driverHandle == IntPtr.Zero)
     {
         MmException.Try(AcmInterop.acmDriverOpen(out this.driverHandle, this.DriverId, 0), "acmDriverOpen");
     }
 }
Exemplo n.º 2
0
        public AcmStream(IntPtr driverId, WaveFormat sourceFormat, WaveFilter waveFilter)
        {
            int num = Math.Max(16384, sourceFormat.AverageBytesPerSecond);

            this.sourceFormat = sourceFormat;
            num -= num % sourceFormat.BlockAlign;
            MmException.Try(AcmInterop.acmDriverOpen(out this.driverHandle, driverId, 0), "acmDriverOpen");
            MmException.Try(AcmInterop.acmStreamOpen(out this.streamHandle, this.driverHandle, sourceFormat, sourceFormat, waveFilter, IntPtr.Zero, IntPtr.Zero, AcmStreamOpenFlags.NonRealTime), "acmStreamOpen");
            this.streamHeader = new AcmStreamHeader(this.streamHandle, num, this.SourceToDest(num));
        }