Add GetLatency again

This commit is contained in:
DataHoarder 2022-01-29 06:02:30 +01:00
parent c3226aff5e
commit d815c08aaa

View file

@ -22,6 +22,7 @@ type Gaborator struct {
coefficientOutputChannel chan []float32
bandsPerOctave int
bandNumberCache int
latency int64
}
func NewGaborator(blockSize int, sampleRate float64, bandsPerOctave int, minimumFrequency, maximumFrequency, referenceFrequency float64, stepSize int) *Gaborator {
@ -31,6 +32,7 @@ func NewGaborator(blockSize int, sampleRate float64, bandsPerOctave int, minimum
bandsPerOctave: bandsPerOctave,
}
ob.bandNumberCache = ob.GetNumberOfBands()
ob.latency = int64(C.gaborator_analysis_support(ob.pointer))
return ob
}
@ -118,6 +120,10 @@ func (g *Gaborator) GetBlockSize() int {
return g.audioBlockSize
}
func (g *Gaborator) GetLatency() int64 {
return g.latency
}
func (g *Gaborator) GetBandwidth() float64 {
return 1200. / float64(g.bandsPerOctave)
}