Ejemplo 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);
        }
Ejemplo n.º 2
0
 internal void Disconnect()
 {
     if (waveOutWindow != null)
     {
         waveOutWindow.Close();
         waveOutWindow = null;
     }
     if (waveOutWindowNative != null)
     {
         waveOutWindowNative.ReleaseHandle();
         waveOutWindowNative = null;
     }
 }