diff options
author | xegineering <me@xegineering.eu> | 2024-12-15 12:25:08 +0100 |
---|---|---|
committer | xegineering <me@xegineering.eu> | 2024-12-15 12:36:59 +0100 |
commit | 196ed013acad91cf89b7a1e086dbbe0d158166d3 (patch) | |
tree | 25b18501ec79b66d674ff6f4555a4ceaff837a6a | |
parent | de2694f182790dd311265e378498d586f9b3ae66 (diff) | |
download | soundbox-go-196ed013acad91cf89b7a1e086dbbe0d158166d3.tar soundbox-go-196ed013acad91cf89b7a1e086dbbe0d158166d3.tar.zst soundbox-go-196ed013acad91cf89b7a1e086dbbe0d158166d3.zip |
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.
-rw-r--r-- | soundbox/pipewire.go | 5 |
1 files changed, 5 insertions, 0 deletions
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", |