Skip to content

Commit

Permalink
Reverted assignments to the original order
Browse files Browse the repository at this point in the history
  • Loading branch information
cwoffenden committed Dec 11, 2024
1 parent f7a27d5 commit 32a9d98
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/audio_worklet.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ function createWasmAudioWorkletProcessor(audioParams) {

// Copy input audio descriptor structs and data to Wasm
inputsPtr = dataPtr;
dataPtr += numInputs * {{{ C_STRUCTS.AudioSampleFrame.__size__ }}};
k = inputsPtr >> 2;
dataPtr += numInputs * {{{ C_STRUCTS.AudioSampleFrame.__size__ }}};
for (i of inputList) {
// Write the AudioSampleFrame struct instance
HEAPU32[k + {{{ C_STRUCTS.AudioSampleFrame.numberOfChannels / 4 }}}] = i.length;
Expand All @@ -129,8 +129,8 @@ function createWasmAudioWorkletProcessor(audioParams) {

// Copy parameters descriptor structs and data to Wasm
paramsPtr = dataPtr;
dataPtr += numParams * {{{ C_STRUCTS.AudioParamFrame.__size__ }}};
k = paramsPtr >> 2;
dataPtr += numParams * {{{ C_STRUCTS.AudioParamFrame.__size__ }}};
for (i = 0; paramArray = parameters[i++];) {
// Write the AudioParamFrame struct instance
HEAPU32[k + {{{ C_STRUCTS.AudioParamFrame.length / 4 }}}] = paramArray.length;
Expand All @@ -144,8 +144,8 @@ function createWasmAudioWorkletProcessor(audioParams) {
// Copy output audio descriptor structs to Wasm (note that dataPtr after
// the struct offsets should now be 16-byte aligned).
outputsPtr = dataPtr;
dataPtr += numOutputs * {{{ C_STRUCTS.AudioSampleFrame.__size__ }}};
k = outputsPtr >> 2;
dataPtr += numOutputs * {{{ C_STRUCTS.AudioSampleFrame.__size__ }}};
for (i of outputList) {
// Write the AudioSampleFrame struct instance
HEAPU32[k + {{{ C_STRUCTS.AudioSampleFrame.numberOfChannels / 4 }}}] = i.length;
Expand Down

0 comments on commit 32a9d98

Please sign in to comment.