コード例 #1
0
ファイル: AcmInterop.cs プロジェクト: tabjin0/audio
 public static extern MmResult acmStreamOpen2(
     out IntPtr hAcmStream,
     IntPtr hAcmDriver,
     IntPtr sourceFormatPointer,
     IntPtr destFormatPointer,
     [In] WaveFilter waveFilter,
     IntPtr callback,
     IntPtr instance,
     AcmStreamOpenFlags openFlags);
コード例 #2
0
ファイル: AcmStream.cs プロジェクト: DevangS/omnibeat
 /// <summary>
 /// Creates a new ACM stream to convert one format to another, using a 
 /// specified driver identified and wave filter
 /// </summary>
 /// <param name="driverId">the driver identifier</param>
 /// <param name="sourceFormat">the source format</param>
 /// <param name="waveFilter">the wave filter</param>
 public AcmStream(IntPtr driverId, WaveFormat sourceFormat, WaveFilter waveFilter)
 {
     int sourceBufferSize = Math.Max(16384, sourceFormat.AverageBytesPerSecond);
     this.sourceFormat = sourceFormat;
     sourceBufferSize -= (sourceBufferSize % sourceFormat.BlockAlign);
     MmException.Try(AcmInterop.acmDriverOpen(out driverHandle, driverId, 0), "acmDriverOpen");
     MmException.Try(AcmInterop.acmStreamOpen(out streamHandle, driverHandle,
                   sourceFormat, sourceFormat, waveFilter, IntPtr.Zero, IntPtr.Zero, AcmStreamOpenFlags.NonRealTime), "acmStreamOpen");
     streamHeader = new AcmStreamHeader(streamHandle, sourceBufferSize, SourceToDest(sourceBufferSize));
 }
コード例 #3
0
ファイル: AcmStream.cs プロジェクト: h4ltYu/EOS
        /// <summary>
        /// Creates a new ACM stream to convert one format to another, using a
        /// specified driver identified and wave filter
        /// </summary>
        /// <param name="driverId">the driver identifier</param>
        /// <param name="sourceFormat">the source format</param>
        /// <param name="waveFilter">the wave filter</param>
        // Token: 0x060007CD RID: 1997 RVA: 0x00016CE4 File Offset: 0x00014EE4
        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));
        }
コード例 #4
0
ファイル: AcmInterop.cs プロジェクト: tabjin0/audio
 public static extern MmResult acmStreamOpen(
     out IntPtr hAcmStream,
     IntPtr hAcmDriver,
     [In, MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "NAudio.Wave.WaveFormatCustomMarshaler")]
     WaveFormat sourceFormat,
     [In, MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "NAudio.Wave.WaveFormatCustomMarshaler")]
     WaveFormat destFormat,
     [In] WaveFilter waveFilter,
     IntPtr callback,
     IntPtr instance,
     AcmStreamOpenFlags openFlags);
コード例 #5
0
        /// <summary>
        /// Creates a new ACM stream to convert one format to another, using a
        /// specified driver identified and wave filter
        /// </summary>
        /// <param name="driverId">the driver identifier</param>
        /// <param name="sourceFormat">the source format</param>
        /// <param name="waveFilter">the wave filter</param>
        public AcmStream(IntPtr driverId, WaveFormat sourceFormat, WaveFilter waveFilter)
        {
            int sourceBufferSize = Math.Max(16384, sourceFormat.AverageBytesPerSecond);

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