Skip to content

Commit

Permalink
Logging and notes for me
Browse files Browse the repository at this point in the history
  • Loading branch information
cwoffenden committed Oct 16, 2024
1 parent 631ade9 commit b87d1eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/audio_worklet.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ function createWasmAudioWorkletProcessor(audioParams) {

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

// Copy input audio descriptor structs and data to Wasm
k = inputsPtr >> 2;
Expand Down Expand Up @@ -115,9 +118,9 @@ function createWasmAudioWorkletProcessor(audioParams) {
// (A garbage-free function TypedArray.copy(dstTypedArray, dstOffset,
// srcTypedArray, srcOffset, count) would sure be handy.. but web does
// not have one, so manually copy all bytes in)
for (i of outputList) {
for (j of i) {
for (k = 0; k < this.samplesPerChannel; ++k) {
for (/*which output*/ i of outputList) {
for (/*which channel Float32Array<samplesPerChannel>*/ j of i) {
for (/*channel index*/ k = 0; k < this.samplesPerChannel; ++k) {
j[k] = HEAPF32[outputDataPtr++];
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/library_webaudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ let LibraryWebAudio = {
#if WEBAUDIO_DEBUG
console.log(`emscripten_start_wasm_audio_worklet_thread_async() adding audioworklet.js...`);
#endif
#if WEBAUDIO_DEBUG
console.log(`emscripten_start_wasm_audio_worklet_thread_async() stack base/sb: ${stackLowestAddress}, size: ${stackSize} (${stackLowestAddress + stackSize})`);
#endif

let audioWorkletCreationFailed = () => {
#if WEBAUDIO_DEBUG
Expand Down

0 comments on commit b87d1eb

Please sign in to comment.