pcm

package
v0.0.0-...-8f00a11 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2016 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBAmplitude

func DBAmplitude(gain float64) (db float64)

DBAmplitude converts from amplitude to power gain.

func DBSquaredAmplitude

func DBSquaredAmplitude(gain float64) (db float64)

DBSquaredAmplitude converts from squared amplitude to power gain.

func FloatInterleave

func FloatInterleave(l, r []float64) ([]float64, error)

FloatInterleave interleaves left and right (dual mono) channels to a stereo interleaved channel.

func FloatMix

func FloatMix(a, b []float64, negate bool, normalize float64) ([]float64, error)

FloatMix mixes two sample buffers normalized by a constant.

Types

type FloatAGC

type FloatAGC struct {
	Attack float64
	Decay  float64
	// contains filtered or unexported fields
}

FloatAGC implements Automatic Gain Control, value settles in range (-0.5, +0.5).

func NewFloatAGC

func NewFloatAGC(attack, decay float64) *FloatAGC

NewFloatAGCC starts a new FloatAGC block.

func (*FloatAGC) Process

func (agc *FloatAGC) Process(in float64) float64

Process a sample.

type FloatSamples

type FloatSamples []float64

func (FloatSamples) Deinterleave

func (s FloatSamples) Deinterleave() ([]float64, []float64, error)

Deinterleave a stereo interleaved channel to dual mono left and right.

func (FloatSamples) Peak

func (s FloatSamples) Peak() float64

Peak value of a buffer.

func (FloatSamples) RMS

func (s FloatSamples) RMS() float64

RMS value of a buffer.

Jump to

Keyboard shortcuts

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