pa

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package pa contains a PulseAudio C API wrapper for managing virtual devices on a system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	// contains filtered or unexported fields
}

Device is a go wrapper around a loaded pulse audio module. It contains internal pointers to the context that created it as well as additional metadata.

func (*Device) Description

func (d *Device) Description() string

Description returns the description for this module.

func (*Device) ID

func (d *Device) ID() int

ID returns the ID of this module.

func (*Device) IsUnloaded

func (d *Device) IsUnloaded() bool

IsUnloaded returns true if this module has been unloaded.

func (*Device) Name

func (d *Device) Name() string

Name returns the name of this module.

func (*Device) Unload

func (d *Device) Unload() error

Unload will unload this pulse device.

type DeviceManager

type DeviceManager struct {
	// contains filtered or unexported fields
}

DeviceManager is an object for managing virtual PulseAudio devices.

func NewDeviceManager

func NewDeviceManager(opts *DeviceManagerOpts) (*DeviceManager, error)

NewDeviceManager returns a new DeviceManager.

func (*DeviceManager) AddSink

func (p *DeviceManager) AddSink(name, description string) (*Device, error)

AddSink adds a new null-sink with the given name and description.

func (*DeviceManager) AddSource

func (p *DeviceManager) AddSource(opts *SourceOpts) (*Device, error)

AddSource adds a new pipe-source with the given name, description, and FIFO path.

func (*DeviceManager) Destroy

func (p *DeviceManager) Destroy() error

Destroy will unload all currently managed PA devices and close the connection to the pulse server.

func (*DeviceManager) Devices

func (p *DeviceManager) Devices() []*Device

Devices returns a list of the current devices managed by this instance.

func (*DeviceManager) SetDefaultSource

func (p *DeviceManager) SetDefaultSource(name string) error

SetDefaultSource will set the default source for recording clients.

func (*DeviceManager) WaitForReady

func (p *DeviceManager) WaitForReady(timeout time.Duration) error

WaitForReady waits for the DeviceManager to be able to execute operations against the PulseAudio server. Since all calls are async, this method SHOULD be run after a new DeviceManager is created.

type DeviceManagerOpts

type DeviceManagerOpts struct {
	PulseServer string
}

DeviceManagerOpts represent options to pass to the device manager.

type SourceOpts

type SourceOpts struct {
	Name                 string
	Description          string
	FifoPath             string
	SampleFormat         string
	Channels, SampleRate int
}

SourceOpts represents options for a creating a new virtual source.

Jump to

Keyboard shortcuts

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