chain

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain struct {
	Sources audio.Selector //selector can hold one or more sources
	Sinks   audio.Router   //router can hold one or more sinks
	Nodes   []audio.Node
	// contains filtered or unexported fields
}

Chain holds a complete chain of audio elements from the Source, through processing nodes ending in a sink. In a typically VoIP architecture one would have one receiving (rx) and transmitting (tx) chain.

func NewChain

func NewChain(opts ...Option) (*Chain, error)

NewChain is the constructor method for an audio chain.

func (*Chain) Enable

func (nc *Chain) Enable(state bool) error

Enable will enable or disable the chain. This is done be enabling or disableing the selected default sink in the chain.

func (*Chain) Enabled

func (nc *Chain) Enabled() (bool, error)

Enabled returns the state if the chain / it's default sink is enabled.

type Option

type Option func(*Options)

Option is the type for a function option

func DefaultSink

func DefaultSink(s string) Option

DefaultSink is a functional option which sets the name of the default sink of an audio chain.

func DefaultSource

func DefaultSource(s string) Option

DefaultSource is a functional option which sets the name of the default source of an audio chain.

func Node

func Node(n audio.Node) Option

Node is a functional option which adds a particular audio.Node to the audio chain. The Node will be put between a the Source and Sink. If serveral Nodes are provided, the order matters. The last Node will be connected to the source, the first one to the sink.

type Options

type Options struct {
	DefaultSource string
	DefaultSink   string
	Nodes         []audio.Node
}

Options is a data structure which holds the option values. The values are set through functional options.

Jump to

Keyboard shortcuts

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