| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ko/docs/Web/API/AudioWorkletProcessor/process | [Back] [Original] |
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
AudioWorkletProcessor process() worklet .
AudioWorkletProcessor , AudioWorkletProcessor process() .
AudioWorkletNode ( quantum ) . , , process() .
:
, 128 , 128 32 . , ( , CPU ). , .
, .
var isActivelyProcessing = audioWorkletProcessor.process(
inputs,
outputs,
parameters,
);
inputs inputs , channel . channel 128 Float32Array. , inputs[n][m][i] n , m , i .
[-1 .. 1] .
inputs (AudioWorkletNode ). n , inputs[n] (0 ).
channel channelCount channelCountMode .
outputs inputs outputs . process() . 0 .
parameters Float32Array . parameterDescriptors getter AudioParam , AudioParam name , Float32Array. .
"a-rate", 128 . , 128 .
"k-rate", , 128 .
AudioWorkletNode Boolean .
AudioWorkletProcessor . , process() .
true Web Audio API , false .
:
AudioWorkletProcessor process true . false . , AudioBufferSourceNode process true , false ( AudioBufferSourceNode play ).process false . GainNode. , gain , garbage-collected .process , 0 , tail-time true .:
return undefined , falsy , false .
return .
process() , . uncaught error , onprocessorerror .
AudioWorkletProcessor . gain customGain .
class WhiteNoiseProcessor extends AudioWorkletProcessor {
process(inputs, outputs, parameters) {
//
const output = outputs[0];
// gain
output.forEach((channel) => {
for (let i = 0; i < channel.length; i++) {
//
// Math.random [0; 1); [-1; 1]
// 1
channel[i] =
(Math.random() * 2 - 1) *
//
// k-rate a-rate
// 1 128
(parameters["customGain"].length > 1
? parameters["customGain"][i]
: parameters["customGain"][0]);
}
});
// ,
//
// garbage-collected true
return true;
}
// process customGain
static get parameterDescriptors() {
return [
{
name: "customGain",
defaultValue: 1,
minValue: 0,
maxValue: 1,
automationRate: "a-rate",
},
];
}
}
| Specification |
|---|
| Web Audio API # process |
.
This page was last modified on 2025 6 24 by MDN contributors.
AudioWorkletProcessorAnalyserNodeAudioBufferAudioBufferSourceNodeAudioContextAudioDestinationNodeAudioListenerAudioNodeAudioParamAudioProcessingEventAudioScheduledSourceNodeAudioSinkInfoAudioWorkletAudioWorkletGlobalScopeAudioWorkletNodeBaseAudioContextBiquadFilterNodeChannelMergerNodeChannelSplitterNodeConstantSourceNodeConvolverNodeDelayNodeDynamicsCompressorNodeGainNodeIIRFilterNodeMediaElementAudioSourceNodeMediaStreamAudioDestinationNodeMediaStreamAudioSourceNodeOfflineAudioCompletionEventOfflineAudioContextOscillatorNodePannerNodePeriodicWaveStereoPannerNodeWaveShaperNodeYour blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |