Skip to content

Commit 90bbe70

Browse files
committed
Outputs working
1 parent ccdb089 commit 90bbe70

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/audio_worklet.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,20 @@ function createWasmAudioWorkletProcessor(audioParams) {
6565
inputsPtr = stackAlloc(stackMemoryNeeded);
6666

6767
// Copy input audio descriptor structs and data to Wasm
68-
k = inputsPtr >> 2;
68+
k = {{{ getHeapOffset('inputsPtr', 'u32') }}};
6969
dataPtr = inputsPtr + numInputs * {{{ C_STRUCTS.AudioSampleFrame.__size__ }}};
7070
for (i of inputList) {
7171
// Write the AudioSampleFrame struct instance
7272
HEAPU32[k + {{{ C_STRUCTS.AudioSampleFrame.numberOfChannels / 4 }}}] = i.length;
7373
HEAPU32[k + {{{ C_STRUCTS.AudioSampleFrame.samplesPerChannel / 4 }}}] = this.samplesPerChannel;
7474
HEAPU32[k + {{{ C_STRUCTS.AudioSampleFrame.data / 4 }}}] = dataPtr;
75+
#if MEMORY64
76+
HEAPU32[k + {{{ C_STRUCTS.AudioSampleFrame.data / 4 + 1 }}}] = dataPtr / 0x100000000;
77+
#endif
7578
k += {{{ C_STRUCTS.AudioSampleFrame.__size__ / 4 }}};
7679
// Marshal the input audio sample data for each audio channel of this input
7780
for (j of i) {
78-
HEAPF32.set(j, dataPtr>>2);
81+
HEAPF32.set(j, {{{ getHeapOffset('dataPtr', 'float') }}});
7982
dataPtr += bytesPerChannel;
8083
}
8184
}

0 commit comments

Comments
 (0)