Skip to content

Commit 424f25f

Browse files
committed
Logging and notes for me
1 parent 943fb11 commit 424f25f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/audio_worklet.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ function createWasmAudioWorkletProcessor(audioParams) {
6464

6565
// Allocate the necessary stack space.
6666
inputsPtr = stackAlloc(stackMemoryNeeded);
67+
#if WEBAUDIO_DEBUG
68+
console.log(`WasmAudioWorkletProcessorr::process() ${inputsPtr} (needed: ${stackMemoryNeeded})`);
69+
#endif
6770

6871
// Copy input audio descriptor structs and data to Wasm
6972
k = inputsPtr >> 2;
@@ -115,9 +118,9 @@ function createWasmAudioWorkletProcessor(audioParams) {
115118
// (A garbage-free function TypedArray.copy(dstTypedArray, dstOffset,
116119
// srcTypedArray, srcOffset, count) would sure be handy.. but web does
117120
// not have one, so manually copy all bytes in)
118-
for (i of outputList) {
119-
for (j of i) {
120-
for (k = 0; k < this.samplesPerChannel; ++k) {
121+
for (/*which output*/ i of outputList) {
122+
for (/*which channel Float32Array<samplesPerChannel>*/ j of i) {
123+
for (/*channel index*/ k = 0; k < this.samplesPerChannel; ++k) {
121124
j[k] = HEAPF32[outputDataPtr++];
122125
}
123126
}

src/library_webaudio.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ let LibraryWebAudio = {
161161
#if WEBAUDIO_DEBUG
162162
console.log(`emscripten_start_wasm_audio_worklet_thread_async() adding audioworklet.js...`);
163163
#endif
164+
#if WEBAUDIO_DEBUG
165+
console.log(`emscripten_start_wasm_audio_worklet_thread_async() stack base/sb: ${stackLowestAddress}, size: ${stackSize} (${stackLowestAddress + stackSize})`);
166+
#endif
164167

165168
let audioWorkletCreationFailed = () => {
166169
#if WEBAUDIO_DEBUG

0 commit comments

Comments
 (0)