Move algorithm into constructor
This commit is contained in:
parent
69b034349a
commit
f0669ce3ba
2 changed files with 10 additions and 6 deletions
|
|
@ -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 } },
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue