ar1st0crat / NWaves

.NET DSP library with a lot of audio processing functions
MIT License
459 stars 71 forks source link

Add ProcessSampleBuffer functions to various audio effects #62

Closed JimBayne closed 8 months ago

JimBayne commented 2 years ago

This update provides 2 new functions for most audio effects: 1) public bool ProcessSampleBuffer(in IntPtr sampleBuffer, in int Channel, in int nChannels, in int frameCount)

The intent is to improve performance and reduce overhead by reducing the # of calls, and performing the updates directly in the source audio buffers.

I use the IntPtr versions in my GuitarAmigo app. They perform very well.

ar1st0crat commented 8 months ago

I suppose there's nothing wrong with this PR. But the philosophy of this lib is more about readability than performance optimization. I didn't want to mix C# and C code from the very beginning, although I realize C parts would run faster (however, I'm not sure that the difference will be noticeable, especially nowadays). Also, there is already the Process(buffer) method implemented for all online filters (including audio effects). And all corresponding current implementations have satisfactory performance.