public override void Run() { var master = System.MasterChannelGroup; master.AddDSP(0, dspLowpass); master.AddDSP(0, dspHighpass); master.AddDSP(0, dspEcho); master.AddDSP(0, dspFlange); do { OnUpdate(); System.Update(); FmodBool Paused = true; if (channel != null) { var res = Fmod.Library.Channel_GetPaused(channel, out Paused); if (res != Result.Ok) { Paused = true; if (res != Result.Err_Invalid_Handle && res != Result.Err_Channel_Stolen) { res.CheckResult(); } } } char lp, hp, e, f; lp = dspLowpass.Bypass ? ' ' : 'x'; hp = dspHighpass.Bypass ? ' ' : 'x'; e = dspEcho.Bypass ? ' ' : 'x'; f = dspFlange.Bypass ? ' ' : 'x'; DrawText("=================================================="); DrawText("Effects Example"); DrawText(""); DrawText("=================================================="); DrawText(); DrawText("Press Space to toggle pause sound"); DrawText("Press 1 to toggle dsp Lowpass effect"); DrawText("Press 2 to toggle dsp Highpass effect"); DrawText("Press 3 to toggle dsp echo effect"); DrawText("Press 4 to toggle dsp flange effect"); DrawText("Press Esc to quit"); DrawText(); DrawText($"{(Paused ? "Paused" : "Playing")} : lowpass[{lp}] highpass[{hp}] echo[{e}] flange[{f}]"); Sleep(50); }while (!ShouldEndExample); master.RemoveDSP(dspLowpass); master.RemoveDSP(dspHighpass); master.RemoveDSP(dspEcho); master.RemoveDSP(dspFlange); }
public override void Run() { do { OnUpdate(); System.Update(); uint ms = 0, lenms = 0; FmodBool isPlaying = false, paused = false; int channelsPlaying = 0; if (Channel != null) { var library = Fmod.Library; var res = library.Channel_IsPlaying(Channel, out isPlaying); if (res != Result.Ok && res != Result.Err_Invalid_Handle && res != Result.Err_Channel_Stolen) { res.CheckResult(); } res = library.Channel_GetPaused(Channel, out paused); if (res != Result.Ok && res != Result.Err_Invalid_Handle && res != Result.Err_Channel_Stolen) { res.CheckResult(); } res = library.Channel_GetPosition(Channel, out ms, TimeUnit.MS); if (res != Result.Ok && res != Result.Err_Invalid_Handle && res != Result.Err_Channel_Stolen) { res.CheckResult(); } library.Channel_GetCurrentSound(Channel, out SoundHandle shandle); if (shandle != default) { res = library.Sound_GetLength(shandle, out lenms, TimeUnit.MS); if (res != Result.Ok && res != Result.Err_Invalid_Handle && res != Result.Err_Channel_Stolen) { res.CheckResult(); } } } System.GetChannelsPlaying(out channelsPlaying, out _); DrawText("=================================================="); DrawText("Load From Memory Example."); DrawText("Copyright (c) Firelight Technologies 2004-2019."); DrawText("=================================================="); DrawText(); DrawText("Press 1 to play a mono sound (drumloop)"); DrawText("Press 2 to play a mono sound (jaguar)"); DrawText("Press 3 to play a stereo sound (swish)"); DrawText(); DrawTime((int)ms, (int)lenms); DrawText($"Channels Playing: {channelsPlaying}"); }while (!ShouldEndExample); }
public void GetMeteringEnabled(out FmodBool inputEnabled, out FmodBool outputEnabled) { library.DSP_GetMeteringEnabled(Handle, out inputEnabled, out outputEnabled).CheckResult(); }
public void GetOpenState(out OpenState openstate, out uint percentbuffered, out FmodBool starving, out FmodBool diskbusy) { library.Sound_GetOpenState(Handle, out openstate, out percentbuffered, out starving, out diskbusy).CheckResult(); }
public abstract void GetDelay(out ulong dspclock_start, out ulong dspclock_end, out FmodBool stopchannels);
public abstract void SetDelay(ulong dspclock_start, ulong dspclock_end, FmodBool stopchannels);