Documentation ¶
Overview ¶
Package pa contains a PulseAudio C API wrapper for managing virtual devices on a system.
Index ¶
- type Device
- type DeviceManager
- func (p *DeviceManager) AddSink(name, description string) (*Device, error)
- func (p *DeviceManager) AddSource(opts *SourceOpts) (*Device, error)
- func (p *DeviceManager) Destroy() error
- func (p *DeviceManager) Devices() []*Device
- func (p *DeviceManager) SetDefaultSource(name string) error
- func (p *DeviceManager) WaitForReady(timeout time.Duration) error
- type DeviceManagerOpts
- type SourceOpts
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 ¶
Description returns the description for this module.
func (*Device) IsUnloaded ¶
IsUnloaded returns true if this module has been unloaded.
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.