Documentation
¶
Overview ¶
Package audiomix sums several sources of interleaved 16-bit PCM into one stream, sample by sample with clipping, padding with silence what a source has not delivered yet.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mixer ¶
type Mixer struct {
// contains filtered or unexported fields
}
Mixer sums sources of interleaved s16le PCM into frames. Each source queues what it delivered; a frame takes the oldest samples of every source, missing ones as silence.
func New ¶
New mixes sources of channels interleaved channels, each queueing at most backlog frames ahead of Mix: a source running fast is trimmed from its oldest samples rather than growing without end.
func (*Mixer) Mix ¶
Mix fills frame, whole interleaved frames, with the sum of the sources' oldest samples, clipped, and drops them from the queues.