void Run() { var quit = new ManualResetEvent(false); Console.CancelKeyPress += (s, a) => { quit.Set(); a.Cancel = true; }; using (var fmod = new FmodSystem()) { fmod.Init(); using (oscillator = (Oscillator)fmod.CreateDsp(DspType.Oscillator)) { oscillator.Play(); while (!quit.WaitOne(0)) { ShowPrompt(); ProcessInput(quit); Thread.Sleep(1); } } fmod.CloseSystem(); } }