Skip to content

Commit 748c167

Browse files
committed
Increased the max buffer count
This takes into account multiple multi-speaker outputs (the spec labels 18).
1 parent 6885585 commit 748c167

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/audio_worklet.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ function createWasmAudioWorkletProcessor(audioParams) {
3636
this.bytesPerChannel = this.samplesPerChannel * {{{ getNativeTypeSize('float') }}};
3737

3838
// Create up-front as many typed views for marshalling the output data as
39-
// may be required (with an arbitrary maximum of 16, for the case where a
39+
// may be required (with an arbitrary maximum of 64, for the case where a
4040
// multi-MB stack is passed), allocated at the *top* of the worklet's
4141
// stack (and whose addresses are fixed). The 'minimum alloc' firstly
4242
// stops STACK_OVERFLOW_CHECK failing (since the stack will be full, and
4343
// 16 being the minimum allocation size due to alignments) and leaves room
4444
// for a single AudioSampleFrame as a minumum.
45-
this.maxBuffers = Math.min(((wwParams.stackSize - /*minimum alloc*/ 16) / this.bytesPerChannel) | 0, /*sensible limit*/ 16);
45+
this.maxBuffers = Math.min(((wwParams.stackSize - /*minimum alloc*/ 16) / this.bytesPerChannel) | 0, /*sensible limit*/ 64);
4646
#if ASSERTIONS
4747
console.assert(this.maxBuffers > 0, `AudioWorklet needs more stack allocating (at least ${this.bytesPerChannel})`);
4848
#endif

0 commit comments

Comments
 (0)