audio

package
v0.0.0-...-74e0192 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateInterval

func CalculateInterval(rate int, targetFrameSize int) int

CalculateInterval dynamically calculates INTERVAL based on the sample rate.

func LowPassFilter

func LowPassFilter(samples []float32, cutoff float64, rate int) []float32

LowPassFilter applies a simple low-pass filter to remove noise from samples.

func ProgressivelyReadFloatArray

func ProgressivelyReadFloatArray(in chan float32, out chan float32)

ProgressivelyReadFloatArray processes PCM data into energy levels for BPM analysis.

func ReadFloatArray

func ReadFloatArray(samples []float32) []float32

ReadFloatArray processes PCM samples into an energy array.

Types

type AudioMetadata

type AudioMetadata struct {
	Rate     int // Sample rate in Hz
	Channels int // Number of audio channels
}

AudioMetadata contains audio properties extracted from a file.

func GetMetadata

func GetMetadata(filePath string) (*AudioMetadata, error)

GetMetadata extracts metadata (sample rate, channels) based on file type using the megasound package.

Jump to

Keyboard shortcuts

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