Skip to content

Commit 71465d2

Browse files
committed
fix: use default pulseaudio sink when device is "default"
Fixes #177
1 parent c331cfb commit 71465d2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

output/driver-pulseaudio.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,13 @@ func newPulseAudioOutput(opts *NewOutputOptions) (*pulseAudioOutput, error) {
5858
}
5959

6060
if opts.Device != "" {
61-
lsink, err := client.SinkByID(opts.Device)
61+
var lsink *pulse.Sink
62+
if opts.Device == "default" {
63+
lsink, err = client.DefaultSink()
64+
} else {
65+
lsink, err = client.SinkByID(opts.Device)
66+
}
67+
6268
if err != nil {
6369
client.Close()
6470
return nil, fmt.Errorf("cannot find pulseaudio sink %s: %w", opts.Device, err)

0 commit comments

Comments
 (0)