Пример #1
0
 /// <summary>
 /// Releases resources held by this WaveBuffer
 /// </summary>
 protected void Dispose(bool disposing)
 {
     if (disposing)
     {
         // free managed resources
     }
     // free unmanaged resources
     if (waveInHandle != IntPtr.Zero)
     {
         WaveInterop.waveInUnprepareHeader(waveInHandle, header, Marshal.SizeOf(header));
         waveInHandle = IntPtr.Zero;
     }
     if (hHeader.IsAllocated)
     {
         hHeader.Free();
     }
     if (hBuffer.IsAllocated)
     {
         hBuffer.Free();
     }
     if (hThis.IsAllocated)
     {
         hThis.Free();
     }
 }
Пример #2
0
 /// <summary>
 /// Place this buffer back to record more audio
 /// </summary>
 public void Reuse()
 {
     // TEST: we might not actually need to bother unpreparing and repreparing
     MmException.Try(WaveInterop.waveInUnprepareHeader(waveInHandle, header, Marshal.SizeOf(header)), "waveUnprepareHeader");
     MmException.Try(WaveInterop.waveInPrepareHeader(waveInHandle, header, Marshal.SizeOf(header)), "waveInPrepareHeader");
     //System.Diagnostics.Debug.Assert(header.bytesRecorded == 0, "bytes recorded was not reset properly");
     MmException.Try(WaveInterop.waveInAddBuffer(waveInHandle, header, Marshal.SizeOf(header)), "waveInAddBuffer");
 }
Пример #3
0
 /// <summary>
 /// Releases resources held by this WaveBuffer
 /// </summary>
 // Token: 0x06000BA8 RID: 2984 RVA: 0x00022E9C File Offset: 0x0002109C
 protected void Dispose(bool disposing)
 {
     if (this.waveInHandle != IntPtr.Zero)
     {
         WaveInterop.waveInUnprepareHeader(this.waveInHandle, this.header, Marshal.SizeOf(this.header));
         this.waveInHandle = IntPtr.Zero;
     }
     if (this.hHeader.IsAllocated)
     {
         this.hHeader.Free();
     }
     if (this.hBuffer.IsAllocated)
     {
         this.hBuffer.Free();
     }
     if (this.hThis.IsAllocated)
     {
         this.hThis.Free();
     }
 }
Пример #4
0
 /// <summary>
 /// Place this buffer back to record more audio
 /// </summary>
 // Token: 0x06000BA5 RID: 2981 RVA: 0x00022DDC File Offset: 0x00020FDC
 public void Reuse()
 {
     MmException.Try(WaveInterop.waveInUnprepareHeader(this.waveInHandle, this.header, Marshal.SizeOf(this.header)), "waveUnprepareHeader");
     MmException.Try(WaveInterop.waveInPrepareHeader(this.waveInHandle, this.header, Marshal.SizeOf(this.header)), "waveInPrepareHeader");
     MmException.Try(WaveInterop.waveInAddBuffer(this.waveInHandle, this.header, Marshal.SizeOf(this.header)), "waveInAddBuffer");
 }