Documentation ¶
Index ¶
- func Gain(chunk *Chunk, multiplier float32)
- func GenerateChunks(totalDur time.Duration, chunkSamples int) chan Chunk
- func GetWavChunks(wavURL string, chunkSamples int) chan Chunk
- type Chunk
- type EmptySink
- type OrderedSink
- type PriorityLocker
- type Sink
- type TimeBuffer
- type TransformSink
- type Transformer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateChunks ¶
GenerateChunks generates sine wave chunks.
func GetWavChunks ¶
GetWavChunks fetches a wav file and returns a channel to PCM chunks.
Types ¶
type EmptySink ¶
type EmptySink struct {
// contains filtered or unexported fields
}
EmptySink outputs all chunks it receives.
type OrderedSink ¶
type OrderedSink struct {
// contains filtered or unexported fields
}
OrderedSink allows appending audio chunks in any order and outputs them ordered.
func NewOrderedSink ¶
func NewOrderedSink(streamStart uint64) *OrderedSink
NewOrderedSink constructor.
func (*OrderedSink) OutputTo ¶
func (sink *OrderedSink) OutputTo(nextSink Sink)
OutputTo forwards all output to next sink.
type PriorityLocker ¶
type PriorityLocker struct {
// contains filtered or unexported fields
}
PriorityLocker hands out lock/unlock wrappers to a single mutex that when locked, first waits until the lock has been locked and unlocked by all callers with lower priority before attempting to lock it.
func NewPriorityLocker ¶
func NewPriorityLocker(lowestPriority uint64) *PriorityLocker
NewPriorityLocker constructor.
type TimeBuffer ¶
type TimeBuffer struct {
// contains filtered or unexported fields
}
TimeBuffer blocks a speedy caller to be ahead of realtime by max amount.
func (*TimeBuffer) Add ¶
func (tb *TimeBuffer) Add(elapsed time.Duration)
Add an amount of time to buffer the caller thinks has passed. It will block if necessary to slow down the caller to be ahead of real time by max.
type TransformSink ¶
type TransformSink struct {
// contains filtered or unexported fields
}
TransformSink allows using audio transformers on passed in chunks.
func NewTransformSink ¶
func NewTransformSink(fx ...Transformer) *TransformSink
NewTransformSink constructor.
func (*TransformSink) OutputTo ¶
func (sink *TransformSink) OutputTo(nextSink Sink)
OutputTo forwards all output to next sink.
type Transformer ¶
type Transformer func(*Chunk)
Transformer is a function that modifies the chunk in place.