예제 #1
0
 public override void Stop()
 {
     tok.Cancel();
     VideoThread?.CloseSocket();
     AudioThread?.CloseSocket();
     VideoThread?.Join();
     AudioThread?.Join();
     base.Stop();
 }
예제 #2
0
        public void ResetDevices()
        {
            // kill thread
            if (AudioThread != null)
            {
                ThreadRunning = false;
                AudioEvent.Set();
                AudioThread.Join(2000);
                AudioThread = null;
            }

            // deconstruct all record/play streams
            if (Recorder != null)
            {
                Recorder.Dispose();
                Recorder = null;
            }

            Players.ForEach(p => p.Dispose());
            Players.SafeClear();

            // will auto be recreated
        }