From 196ed013acad91cf89b7a1e086dbbe0d158166d3 Mon Sep 17 00:00:00 2001 From: xegineering Date: Sun, 15 Dec 2024 12:25:08 +0100 Subject: pipewire: Assert OS is GNU / Linux PipeWire is a Linux-specific sound system. This commit adds a proper error if the operating is not matching. --- soundbox/pipewire.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/soundbox/pipewire.go b/soundbox/pipewire.go index 0443766..7ee38a2 100644 --- a/soundbox/pipewire.go +++ b/soundbox/pipewire.go @@ -13,6 +13,7 @@ import ( "log" "net" "os/exec" + "runtime" "sync" "unsafe" ) @@ -86,6 +87,10 @@ func StreamPipewireContext(ctx context.Context, targets []net.HardwareAddr) erro } defer lock.Unlock() + if runtime.GOOS != "linux" { + return fmt.Errorf("Only the GNU / Linux operating system is supported") + } + cmd := exec.CommandContext( ctx, "ffmpeg", -- cgit v1.2.3-70-g09d2