Documentation ¶
Overview ¶
Package audio implements the Sigourney audio engine.
Index ¶
- Constants
- type Clip
- type Delay
- type Dup
- type Engine
- func (e *Engine) AddTicker(t Ticker)
- func (s *Engine) Input(name string, p Processor)
- func (s *Engine) Inputs() []string
- func (e *Engine) Process() []Sample
- func (e *Engine) RemoveTicker(t Ticker)
- func (e *Engine) Render(frames int) []Sample
- func (e *Engine) Start() error
- func (e *Engine) Stop() error
- type Env
- type Filter
- type Mul
- type MulSum
- type Noise
- type Output
- type Processor
- type Quant
- type Rand
- type Sample
- type Sin
- type Sink
- type Skip
- type Step
- type Sum
- type TableOsc
- type Ticker
- type Value
Constants ¶
const (
FrameLength = 256 * nChannels
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dup ¶
type Dup struct {
// contains filtered or unexported fields
}
Dup splits a Processor into multiple audio streams.
func (*Dup) Output ¶
Output creates and returns a new Output Processor. Each Output should be Closed when it is no longer in use.
type Engine ¶
type Engine struct { sync.Mutex // Must be held while mutating the Processor graph. // contains filtered or unexported fields }
Engine implements the root of an Processor graph.
func (*Engine) RemoveTicker ¶
type Output ¶
type Output struct {
// contains filtered or unexported fields
}
An Output is a Processor endpoint provided by Dup.
type Processor ¶
type Processor interface {
Process(buffer []Sample)
}
Processor implements an audio source.
As with io.Reader, the caller passes a buffer (or "frame") to the Processor and the Processor populates the buffer with sample data. Unlike io.Reader, the Processor must populate the entire buffer.
While audio is being generated and the Processor is active, its Process method will be called for each audio frame in the stream, so the Processor may use on the number of Process calls to maintain its internal state.
type Sink ¶
type Sink interface { // Input attaches the given Processor to the specified named input. Input(name string, p Processor) // Inputs enumerates the Sink's named inputs. Inputs() []string }
A Sink is a consumer of audio data with one or more named inputs.
type TableOsc ¶
type TableOsc struct {
// contains filtered or unexported fields
}
func NewBandLimitedSaw ¶
func NewBandLimitedSaw() *TableOsc
func NewBandLimitedSquare ¶
func NewBandLimitedSquare() *TableOsc
func NewBandLimitedTriangle ¶
func NewBandLimitedTriangle() *TableOsc