v0.1.0 initial commit

This commit is contained in:
2026-07-15 01:28:56 -04:00
commit 874abee663
35 changed files with 3486 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
package audio
// Muter gates playback of a wrapped Engine. The mute state is a host concern:
// the engine state machine is unaware and both backends stay untouched
type Muter struct {
Engine
muted bool
}
func NewMuter(e Engine) *Muter { return &Muter{Engine: e} }
// Play forwards to the wrapped Engine unless gated. In-flight pw-play
// processes are not killed; effects are under 300ms
func (m *Muter) Play(fx Effect) {
if !m.muted {
m.Engine.Play(fx)
}
}
// Toggle flips the gate and reports the new muted state
func (m *Muter) Toggle() bool {
m.muted = !m.muted
return m.muted
}
// Muted reports whether playback is gated
func (m *Muter) Muted() bool { return m.muted }