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(); } }
private void btnPlay_Click(object sender, EventArgs e) { if (channel != null && channel.IsPlaying) { return; } oscillator = (Oscillator)fmod.CreateDsp(DspType.Oscillator); channel = oscillator.Play(); }
private void btnGetSystemObjectWhenNotInitialized_Click(object sender, EventArgs e) { var fmod = new FmodSystem(); fmod.Init(); var dsp = fmod.CreateDsp(DspType.Oscillator); var channel = fmod.PlayDsp(dsp); var fmod2 = channel.SystemInstance; fmod.CloseSystem(); }