pactl

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenForChanges

func ListenForChanges(callback func())

func MoveSinkInput

func MoveSinkInput(sinkInputID string, sinkName string)

func MoveSourceOutput

func MoveSourceOutput(sourceOutputID string, sourceName string)

func SetDefaultSink

func SetDefaultSink(sinkName string)

func SetDefaultSource

func SetDefaultSource(sourceName string)

func SetSinkInputMuted

func SetSinkInputMuted(sinkInputID string, muted bool)

func SetSinkInputVolume

func SetSinkInputVolume(sinkInputID string, volume string)

func SetSinkMuted

func SetSinkMuted(sinkName string, muted bool)

func SetSinkVolume

func SetSinkVolume(sinkName string, volume string)

func SetSourceInputMuted

func SetSourceInputMuted(sourceInputID string, muted bool)

func SetSourceInputVolume

func SetSourceInputVolume(sourceInputID string, volume string)

func SetSourceMuted

func SetSourceMuted(sourceName string, muted bool)

func SetSourceVolume

func SetSourceVolume(sourceName string, volume string)

Types

type Sink

type Sink struct {
	ID        int    `json:"id" doc:"The id of the sink. Same  as name"`
	Name      string `json:"name" doc:"The name of the sink. Same as id"`
	Label     string `json:"label" doc:"Human-readable label for the sink"`
	Volume    int    `json:"volume" doc:"Current volume level of the sink"`
	Muted     bool   `json:"muted" doc:"Whether the sink is muted"`
	IsDefault bool   `json:"isDefault" doc:"Whether this sink is the current default"`
}

func GetSinks

func GetSinks() ([]Sink, error)

type SinkInput

type SinkInput struct {
	ID     int    `json:"id" doc:"The id of the sink. Same  as name"`
	SinkID int    `json:"sinkId" doc:"Id of parrent device, same as sink.id"`
	Label  string `json:"label" doc:"Human-readable label for the sink"`
	Volume int    `json:"volume" doc:"Current volume level of the sink"`
	Muted  bool   `json:"muted" doc:"Whether the sink is muted"`
}

func GetSinkInputs

func GetSinkInputs() ([]SinkInput, error)

type Source

type Source struct {
	ID        int    `json:"id" doc:"Unique numeric identifier of the source"`
	Name      string `json:"name" doc:"Unique string identifier of the source"`
	Label     string `json:"label" doc:"Human-readable label for the source"`
	Volume    int    `json:"volume" doc:"Current volume level of the source"`
	Muted     bool   `json:"muted" doc:"Whether the source is muted"`
	Monitor   string `json:"monitor" doc:"Name of monitor source"`
	Monitored bool   `json:"monitored" doc:"Whether source is being monitored"`
	IsDefault bool   `json:"isDefault" doc:"Whether this source is the current default"`
}

func GetSources

func GetSources() ([]Source, error)

type Status

type Status = struct {
	Sinks      []Sink              `json:"sinks" doc:"List of audio devices"`
	SinkInputs []SinkInput         `json:"sinkInputs" doc:"List of applications that are playing audio"`
	Sources    []Source            `json:"sources" doc:"List of microphones and other sources"`
	BuildInfo  buildinfo.BuildInfo `json:"buildInfo" doc:"Build information"`
}

func GetStatus

func GetStatus() Status

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL