/// <summary> /// Used to ensure that all started threads and processes are shut down correctly /// </summary> private void CompleteTest_FormClosing() { if (microphone != null) { microphone.StopRecording(); } if (playAudio != null) { playAudio.StopPlayBack(); playAudio = null; } }
private void InitializeRadioCommunications() { //Can be used to find out all of the capture devices on the system. //IList<string> audioCaptureDevices = AudioCapture.AvailableDevices; //foreach (var item in audioCaptureDevices) //{ // string availableCaptureDevices = item.ToString(); //} //Initialize the Microphone using the default microphone StartMicrophone(audioSamplingRate, microphoneGain, AudioCapture.DefaultDevice, ALFormat.Mono16, numberOfSamples * 2); //Start the process to send out microphone data through the socket StartThreadSendingMicrophoneSoundToSignalPDU(); //Initialize the audio player playAudio = new AudioOUT.PlayAudio(); }