Skip to content

SilentAudio

namespace Griff.Runtime;
public sealed class SilentAudio : IAudio

Audio that does nothing: for tests and headless runs. It remembers its volume settings, and keeps time for the music it was asked to play as if it were heard, so beat clocks still count.

public string? Music { get; }
public double MusicLength { get; set; }

How long the music lasts, for a test to pretend; 0 (the default) never ends.

public float MusicTempo { get; set; }

The music’s tempo, for a test to pretend (a metronome’s says its own).

public double MusicTime { get; }
public float MusicVolume { get; set; }
public bool Muted { get; set; }
public float SoundVolume { get; set; }
public float Volume { get; set; }
public void Advance(float seconds)
public void CrossfadeMusic(string music, float seconds, float volume = 0.6f, bool loop = true)
public void FadeOutMusic(float seconds)
public void Play(string sound, float volume = 1f)
public void PlayMetronome(float tempo, int beatsPerBar = 4, float volume = 1f)
public void PlayMusic(string music, float volume = 0.6f, bool loop = true)
public void PlayMusicFrom(string music, double seconds, float volume = 0.6f, bool loop = true)
public void StopAll()
public void StopMusic()