Esempio n. 1
0
        /// <summary>
        /// Dispose pattern
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (recording)
                {
                    StopRecording();
                }
                if (buffers != null)
                {
                    for (int n = 0; n < numBuffers; n++)
                    {
                        buffers[n].Dispose();
                    }
                    buffers = null;
                }
                WaveInterop.waveInClose(waveInHandle);
                waveInHandle = IntPtr.Zero;
                if (waveInWindow != null)
                {
                    waveInWindow.ReleaseHandle();
                    waveInWindow = null;
                }
            }

            base.Dispose(disposing);
        }
Esempio n. 2
0
 private void CloseWaveInDevice()
 {
     WaveInterop.waveInReset(this.waveInHandle);
     if (this.buffers != null)
     {
         for (int i = 0; i < this.buffers.Length; i++)
         {
             this.buffers[i].Dispose();
         }
         this.buffers = null;
     }
     WaveInterop.waveInClose(this.waveInHandle);
     this.waveInHandle = IntPtr.Zero;
 }
 private void CloseWaveInDevice()
 {
     // Some drivers need the reset to properly release buffers
     WaveInterop.waveInReset(waveInHandle);
     if (buffers != null)
     {
         for (int n = 0; n < buffers.Length; n++)
         {
             buffers[n].Dispose();
         }
         buffers = null;
     }
     WaveInterop.waveInClose(waveInHandle);
     waveInHandle = IntPtr.Zero;
 }