Skip to content

Commit

Permalink
vst2: align with new pipe api
Browse files Browse the repository at this point in the history
  • Loading branch information
dudk committed Aug 20, 2019
1 parent 559231c commit 5ec33b8
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,19 @@ type Processor struct {
}

// Process returns processor function with default settings initialized.
func (p *Processor) Process(pipeID string, sampleRate, numChannels, bufferSize int) (func([][]float64) ([][]float64, error), error) {
p.bufferSize = bufferSize
func (p *Processor) Process(pipeID string, sampleRate, numChannels int) (func([][]float64) ([][]float64, error), error) {
p.sampleRate = sampleRate
p.numChannels = numChannels
p.Plugin.SetCallback(p.callback())
p.Plugin.SetBufferSize(int(p.bufferSize))
p.Plugin.SetSampleRate(int(p.sampleRate))
p.Plugin.SetSpeakerArrangement(int(p.numChannels))
p.Plugin.SetSampleRate(p.sampleRate)
p.Plugin.SetSpeakerArrangement(p.numChannels)
p.Plugin.Resume()
var currentSize int
return func(b [][]float64) ([][]float64, error) {
if bufferSize := signal.Float64(b).Size(); currentSize != bufferSize {
p.Plugin.SetBufferSize(p.bufferSize)
currentSize = bufferSize
}
b = p.Plugin.Process(b)
p.currentPosition += int64(signal.Float64(b).Size())
return b, nil
Expand Down

0 comments on commit 5ec33b8

Please sign in to comment.