Skip to content
forked from clandry94/agraph

AGraph is a graph based audio filtering library for Go

License

Notifications You must be signed in to change notification settings

afotescu/agraph

 
 

Repository files navigation

Build Status codecov

AGraph

AGraph is a graph based audio processing library for Go! Inspired from implementing binaural audio virtualization with Libavfilter and frustrated by the severe lack of audio processing libraries for Go, I decided to make my own.

Usage

Using this library is simple, all you need to do is initialize filter nodes, connect them, start each node, then feed your wave pulse code modulated (PCM) data into the first sink. Below is an example of creating an audio file reader, setting up a graph with a convolution filter and a volume filter, and pumping data through it.

reader, err := agraph.NewWaveReader(file)
if err != nil {
	fmt.Println(err)
}

convolutionNode, _ := agraph.NewNode(agraph.ConvolutionFilter, "convoluter")
volumeNode, _ := agraph.NewNode(agraph.VolumeFilter, "volume booster")

convolutionNode.SetSink(volumeNode.Source())
volumeNode.SetSink(make(chan []float64, agraph.SOURCE_SIZE)

go convolutionNode.Process()
go volumeNode.Process()

for {
    data, err := reader.ReadSampleFloat()
    if err ! nil {
        fmt.Error(err)
        break
    }

    convolutionNode.Source() <- data
    filteredData = <- volumeNode.Sink()
}

Todo

  • wave file reading
  • wave file writing
  • Convolution filter
  • Delay Filter
  • Finite Impulse Response filter
  • volume filter (was the first filter, so is technically not correct in many ways)
  • leaky integrator filter
  • FFT
  • some frequency domain filters

About

AGraph is a graph based audio filtering library for Go

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%