add channel block processor
This commit is contained in:
parent
8b35eadd7d
commit
481f5df794
19
goborator.go
19
goborator.go
|
@ -5,6 +5,7 @@ package goborator
|
|||
import "C"
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
|
@ -133,6 +134,24 @@ func (g *Gaborator) gaborTransform(audioData []float32) {
|
|||
}
|
||||
}
|
||||
|
||||
func (g *Gaborator) GaborBlockTransform(source chan []float32) [][]float32 {
|
||||
|
||||
for {
|
||||
block, more := <-source
|
||||
if !more {
|
||||
break
|
||||
}
|
||||
err := g.Process(block)
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
g.ProcessingFinished()
|
||||
|
||||
return g.coefficients
|
||||
}
|
||||
|
||||
func (g *Gaborator) GaborTransform(source chan float32) [][]float32 {
|
||||
|
||||
audioData := make([]float32, 0, g.audioBlockSize)
|
||||
|
|
Loading…
Reference in a new issue