Documentation
¶
Index ¶
- func AnalyzeHighestFrequency(samples []int16, sampleRate int) float64
- func FindPeakAmplitude(samples []int16) int16
- func LinearSummation(samples ...[]int16) ([]int16, error)
- func LoadWav(filename string) ([]int16, int, error)
- func LowPassFilter(samples []int16, sampleRate int, cutoffFrequency float64) []int16
- func NormalizeSamples(samples []int16, targetPeak int16) []int16
- func PadSamples(wave1, wave2 []int16) ([]int16, []int16)
- func RMSMixing(samples ...[]int16) ([]int16, error)
- func SaveWav(filename string, samples []int16, sampleRate int) error
- func WeightedSummation(weights []float64, samples ...[]int16) ([]int16, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnalyzeHighestFrequency ¶ added in v0.1.0
AnalyzeHighestFrequency estimates the highest frequency in the audio signal
func FindPeakAmplitude ¶ added in v0.1.0
FindPeakAmplitude returns the maximum absolute amplitude in the sample set
func LinearSummation ¶
LinearSummation mixes multiple audio samples by adding them together. It automatically clamps the sum to avoid overflow and distortion.
func LoadWav ¶ added in v0.1.0
LoadWav loads a .wav file and returns its samples as []int16 (stereo) along with the sample rate. If the file is mono, it converts it to stereo by duplicating the mono channel to both the left and right channels.
func LowPassFilter ¶ added in v0.1.0
LowPassFilter is a simple low-pass filter that can remove high frequencies
func NormalizeSamples ¶ added in v0.1.0
NormalizeSamples scales the samples so the peak amplitude matches the given max amplitude
func PadSamples ¶ added in v0.1.0
PadSamples pads the shorter sample with zeros (silence) so that both samples have the same length.
Types ¶
This section is empty.