public static void ListenForInput(AudioInputBuffer_old buffer)
        {
            Thread thread           = null;
            var    audioQueueThread = new InputAudioQueueThread_old(buffer, thread);

            thread = new Thread(new ParameterizedThreadStart(HandleParameterizedThreadStart));
            BufferThreads.Add(buffer, audioQueueThread);

            thread.Start(audioQueueThread);
        }
        public static void StopListening(AudioInputBuffer_old buffer)
        {
            InputAudioQueueThread_old audioQueueThread = null;

            if (BufferThreads.ContainsKey(buffer))
            {
                audioQueueThread = BufferThreads[buffer];
            }

            if (audioQueueThread != null && audioQueueThread.IsRunning)
            {
                audioQueueThread.RequestStop();
                audioQueueThread.IsRunning = false;
                BufferThreads.Remove(buffer);
            }
        }
Ejemplo n.º 3
0
 public InputAudioQueueThread(AudioInputBuffer_old buffer, Thread thread)
 {
     this.Buffer = buffer;
     this.Thread = thread;
 }