From 5b1017353b04448aa52874893f985d9fa343e57e Mon Sep 17 00:00:00 2001 From: Dharma Bellamkonda Date: Tue, 9 Jun 2026 17:59:59 -0600 Subject: [PATCH] Exclude piper speaker from macOS builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On macOS, piper is never used — the runtime selects macOS Speech Synthesis instead. Adding //go:build !darwin to piper.go prevents the piper binary and embedded voice assets from being linked into the macOS binary, reducing it from 159 MB to 29 MB (82% smaller). A minimal stub in piper_darwin.go satisfies the compiler without importing any piper dependencies. Co-Authored-By: Claude Sonnet 4.6 --- pkg/synthesizer/speakers/piper.go | 2 ++ pkg/synthesizer/speakers/piper_darwin.go | 13 +++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 pkg/synthesizer/speakers/piper_darwin.go diff --git a/pkg/synthesizer/speakers/piper.go b/pkg/synthesizer/speakers/piper.go index 1232b293..10dfcb4d 100644 --- a/pkg/synthesizer/speakers/piper.go +++ b/pkg/synthesizer/speakers/piper.go @@ -1,3 +1,5 @@ +//go:build !darwin + package speakers import ( diff --git a/pkg/synthesizer/speakers/piper_darwin.go b/pkg/synthesizer/speakers/piper_darwin.go new file mode 100644 index 00000000..4e0e5549 --- /dev/null +++ b/pkg/synthesizer/speakers/piper_darwin.go @@ -0,0 +1,13 @@ +//go:build darwin + +package speakers + +import ( + "time" + + "github.com/dharmab/skyeye/pkg/synthesizer/voices" +) + +func NewPiperSpeaker(_ voices.Voice, _ float64, _ time.Duration) (Speaker, error) { + panic("unreachable: piper is not used on macOS") +}