Move algorithm into constructor

This commit is contained in:
Aria 2025-09-24 17:32:03 -07:00
parent 69b034349a
commit f0669ce3ba
2 changed files with 10 additions and 6 deletions

View file

@ -403,6 +403,11 @@ export const getDistortionAlgorithm = (algo) => {
};
export const getDistortion = (distort, postgain, algorithm) => {
const { _algorithm, index } = getDistortionAlgorithm(algorithm);
return getWorklet(getAudioContext(), 'distort-processor', { distort, postgain, algorithm: index });
const { index } = getDistortionAlgorithm(algorithm);
return getWorklet(
getAudioContext(),
'distort-processor',
{ distort, postgain },
{ processorOptions: { algorithm: index } },
);
};