Documentation ¶
Index ¶
Constants ¶
View Source
const ( SourceFloat32 = SourceFormat(iota) SourceInt16 SourceInt32 )
Variables ¶
This section is empty.
Functions ¶
func GetBlocksInterface ¶
func GetBlocksInterface(s Source) interface{}
Types ¶
type AllowedSourceTypes ¶
type ForwardSink ¶
func NewForwardSink ¶
func NewForwardSink(target Sink) *ForwardSink
func (*ForwardSink) GetDuration ¶
func (n *ForwardSink) GetDuration() time.Duration
func (*ForwardSink) GetSamplesRead ¶
func (n *ForwardSink) GetSamplesRead() uint64
func (*ForwardSink) Process ¶
func (n *ForwardSink) Process(source Source)
type Source ¶
type Source interface { GetBitDepth() int GetSampleRate() int GetChannels() int GetFormat() SourceFormat ToFloat32() TypedSource[float32] ToInt16() TypedSource[int16] ToInt32(bitDepth int) TypedSource[int32] IngestFloat32(buf []float32) IngestInt8(buf []int8, bitDepth int) IngestInt16(buf []int16, bitDepth int) IngestInt24(buf []byte, bitDepth int) IngestInt32(buf []int32, bitDepth int) //Split a Source into multiple ones. After calling this function, the source is locked. Split(n int) []Source Close() Unlock() Locked() bool }
func NewInterface ¶
func NewTypedInterface ¶
func Split ¶
func Split[T AllowedSourceTypes](s TypedSource[T], n int) (sources []Source)
type SourceFormat ¶
type SourceFormat int
type TypedSource ¶
type TypedSource[T AllowedSourceTypes] interface { Source New() TypedSource[T] IngestNative(buf []T, bitDepth int) GetBlocks() chan []T // SwapBlocks swaps current Blocks with a different one, and returns old one SwapBlocks(blocks chan []T) chan []T }
func NewSource ¶
func NewSource[T AllowedSourceTypes](bitDepth, sampleRate, channels int) TypedSource[T]
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
internal/resampler
Package resampler implements audio resampler.
|
Package resampler implements audio resampler. |
Click to show internal directories.
Click to hide internal directories.