Fix append -> append + copy
This commit is contained in:
parent
f3afd2eca0
commit
01e4b00ac7
|
@ -119,7 +119,8 @@ func (g *Gaborator) gaborTransform(audioData []float32) {
|
|||
// keep the new maximum
|
||||
g.mostRecentCoefficentIndex = coefficientIndex
|
||||
// copy the oldest data to the history
|
||||
g.fixedCoefficents = append(g.fixedCoefficents, g.coefficients[circularIndex])
|
||||
g.fixedCoefficents = append(g.fixedCoefficents, make([]float32, len(g.coefficients[circularIndex])))
|
||||
copy(g.fixedCoefficents[len(g.fixedCoefficents)-1], g.coefficients[circularIndex])
|
||||
|
||||
// fill the oldest with zeros
|
||||
for j := range g.coefficients[circularIndex] {
|
||||
|
|
Loading…
Reference in a new issue