目前我有以下代码
AudioContext = window.AudioContext || window.webkitAudioContext;
context = new AudioContext({latencyHint: 'interactive'});
processor = context.createScriptProcessor(bufferSize, 1, 1);
processor.connect(context.destination);
context.resume();
我需要迁移 AudioWorkletNode。这里的主要功能是“createScriptProcessor”。我正在努力寻找与此相当的东西。 请帮忙!
最佳答案
代替 createScriptProcessor
,您需要一些更复杂的东西。你可以找到几个 examples in the spec itself .有other demos与基本 Hello Audio Worklet是一个很好的起点。
关于javascript - 如何从 ScriptProcessorNode 迁移到 AudioWorkletNode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68007500/