} // end enumerateDevices private void startButton_Click(object sender, EventArgs e) { List <string> inputStrings = inputsBox.CheckedItems.OfType <String>().ToList <String>(); int sampleRate = Convert.ToInt32(sampleBox.SelectedItem as String); string selectedOutput = outputBox.SelectedItem as String; RtAudio.Api api = (RtAudio.Api)apiBox.SelectedIndex; Console.WriteLine("Selected API: {0}", api.ToString()); // Try to get the global instance. If we fail, make our own. try { manager = RtAudioManager.GetInstance(); } catch (RtAudioManagerApiException) { manager = new RtAudioManager(); } // end try/catch mixer = manager.CreateMixer(inputStrings, selectedOutput, sampleRate); mixer.Start(); stopButton.Enabled = true; startButton.Enabled = false; }
static void Main(string[] args) { // Get global instance manager = RtAudioManager.GetInstance(); // Create a simple mixer, mixing the default input device to the default output device RtStreamMixer mixer = manager.CreateMixer(new List<string>() { "Default" }, "Default"); // Start the mixer mixer.Start(); // Infinite Loop while (true) { Thread.Sleep(50); } // end while } // end Main