loadConvolverKernel method
Load an impulse-response kernel into the convolver. Returns the assigned kernel ID on success, 0 on failure.
Implementation
int loadConvolverKernel(Float32List samples, int channels, int kernelId) {
if (_enginePtr == ffi.nullptr) return 0;
int frameCount = samples.length ~/ channels;
final ptr = _malloc(samples.length * ffi.sizeOf<ffi.Float>()).cast<ffi.Float>();
try {
final list = ptr.asTypedList(samples.length);
list.setAll(0, samples);
return _loadConvolverKernel(_enginePtr, ptr, frameCount, channels, kernelId);
} finally {
_freePtr(ptr.cast<ffi.Void>());
}
}