pulse

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clients added in v1.10.0

func Clients() (int, error)

func UnloadModule added in v1.14.0

func UnloadModule(ctx context.Context, module int) error

UnloadModule unloads a module from the pulse daemon, e.g. the null-sink owned by an egress.

Types

type Client

type Client struct {
	Index       int                    `json:"index"`
	Driver      string                 `json:"driver"`
	OwnerModule string                 `json:"owner_module"`
	Properties  map[string]interface{} `json:"properties"`
}

type Device

type Device struct {
	Index               int                    `json:"index"`
	State               string                 `json:"state"`
	Name                string                 `json:"name"`
	Description         string                 `json:"description"`
	Driver              string                 `json:"driver"`
	SampleSpecification string                 `json:"sample_specification"`
	ChannelMap          string                 `json:"channel_map"`
	OwnerModule         int                    `json:"owner_module"`
	Mute                bool                   `json:"mute"`
	Volume              map[string]Volume      `json:"volume"`
	Balance             float64                `json:"balance"`
	BaseVolume          Volume                 `json:"base_volume"`
	MonitorSource       string                 `json:"monitor_source"`
	Latency             Latency                `json:"latency"`
	Flags               []string               `json:"flags"`
	Properties          map[string]interface{} `json:"properties"`
	Ports               []interface{}          `json:"ports"`
	ActivePort          interface{}            `json:"active_port"`
	Formats             []string               `json:"formats"`
}

type EgressInfo

type EgressInfo struct {
	EgressID      string
	SinkInputs    int
	SourceOutputs int
}

type IOBase

type IOBase struct {
	Index               int                    `json:"index"`
	Driver              string                 `json:"driver"`
	OwnerModule         string                 `json:"owner_module"`
	Client              string                 `json:"client"`
	SampleSpecification string                 `json:"sample_specification"`
	ChannelMap          string                 `json:"channel_map"`
	Format              string                 `json:"format"`
	Corked              bool                   `json:"corked"`
	Mute                bool                   `json:"mute"`
	Volume              map[string]Volume      `json:"volume"`
	Balance             float64                `json:"balance"`
	BufferLatencyUSec   float64                `json:"buffer_latency_usec"`
	SinkLatencyUSec     float64                `json:"sink_latency_usec"`
	ResampleMethod      string                 `json:"resample_method"`
	Properties          map[string]interface{} `json:"properties"`
}

type Latency

type Latency struct {
	Actual     float64 `json:"actual"`
	Configured float64 `json:"configured"`
}

type Module

type Module struct {
	Name         string                 `json:"name"`
	Argument     string                 `json:"argument"`
	UsageCounter string                 `json:"usage_counter"`
	Properties   map[string]interface{} `json:"properties"`
}

type PulseInfo

type PulseInfo struct {
	Modules       []Module       `json:"modules"`
	Sinks         []Device       `json:"sinks"`
	Sources       []Device       `json:"sources"`
	SinkInputs    []SinkInput    `json:"sink_inputs"`
	SourceOutputs []SourceOutput `json:"source_outputs"`
	Clients       []Client       `json:"clients"`
	Samples       []interface{}  `json:"samples"`
	Cards         []interface{}  `json:"cards"`
}

func List

func List() (*PulseInfo, error)

func ListContext added in v1.14.0

func ListContext(ctx context.Context) (*PulseInfo, error)

func (*PulseInfo) GetEgressInfo

func (info *PulseInfo) GetEgressInfo() map[int]*EgressInfo

type SinkInput

type SinkInput struct {
	IOBase `json:",inline"`
	Sink   int `json:"sink"`
}

type SourceOutput

type SourceOutput struct {
	IOBase `json:",inline"`
	Source int `json:"source"`
}

type Volume

type Volume struct {
	Value        int    `json:"value"`
	ValuePercent string `json:"value_percent"`
	Db           string `json:"db"`
}

Jump to

Keyboard shortcuts

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