Documentation ¶
Index ¶
- Variables
- func BitCrush(buf *audio.PCMBuffer, factor float64)
- func Decimate(buf *audio.PCMBuffer, factor int) (err error)
- func FullWaveRectifier(buf *audio.PCMBuffer) error
- func MonoDownmix(buf *audio.PCMBuffer) error
- func MonoRMS(b *audio.PCMBuffer, windowSize int) error
- func NominalScale(buf *audio.PCMBuffer) error
- func NormalizeMax(buf *audio.PCMBuffer)
- func PCMScale(buf *audio.PCMBuffer) error
- func Quantize(buf *audio.PCMBuffer, bitDepth int)
- func Resample(buf *audio.PCMBuffer, fs float64) error
Constants ¶
This section is empty.
Variables ¶
var ( CrusherMinFactor = 1.0 CrusherMaxFactor = 2097152.0 )
Functions ¶
func BitCrush ¶
BitCrush reduces the resolution of the sample to the target bit depth Note that bit crusher effects are usually made of this feature + a decimator
func Decimate ¶
Decimate drops samples to switch to a lower sample rate. Factor is the decimation factor, for instance a factor of 2 of a 44100Hz buffer will convert the buffer in a 22500 buffer.
func FullWaveRectifier ¶
FullWaveRectifier to make all signal positive See https://en.wikipedia.org/wiki/Rectifier#Full-wave_rectification
func MonoDownmix ¶
MonoDownmix converts the buffer to a mono buffer by downmixing the channels together.
func MonoRMS ¶
MonoRMS converts the buffer to mono and apply an RMS treatment. rms = sqrt ( (1/n) * (x12 + x22 + … + xn2) ) multiplying by 1/n effectively assigns equal weights to all the terms, making it a rectangular window. Other window equations can be used instead which would favor terms in the middle of the window. This results in even greater accuracy of the RMS value since brand new samples (or old ones at the end of the window) have less influence over the signal’s power.) TODO: use a sine wave at amplitude of 1: rectication + average = 1.4 (1/square root of 2)
func NominalScale ¶
NominalScale converts the input to a -1.0 / +1.0 scale
func NormalizeMax ¶
NormalizeMax sets the max value to 1 and normalize the rest of the data.
func PCMScale ¶
PCMScale converts a buffer with audio content from -1 to 1 into the PCM scale based on the buffer's bitdepth.
Types ¶
This section is empty.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
filters implement easy to use audio filters.
|
filters implement easy to use audio filters. |