From 7aa217828b5ee8cfc553a98ba8f7cdebff01b033 Mon Sep 17 00:00:00 2001 From: Jade Rowland Date: Mon, 20 Nov 2023 23:06:35 -0500 Subject: [PATCH] testing --- packages/superdough/superdough.mjs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/superdough/superdough.mjs b/packages/superdough/superdough.mjs index 00e2f42c..be9a3df9 100644 --- a/packages/superdough/superdough.mjs +++ b/packages/superdough/superdough.mjs @@ -30,7 +30,11 @@ let audioContext; export const getAudioContext = () => { if (!audioContext) { audioContext = new AudioContext(); + var maxChannelCount = audioContext.destination.maxChannelCount; + audioContext.destination.channelCount = maxChannelCount; } + //console.log(audioContext.destination.maxChannelCount); + return audioContext; }; @@ -39,7 +43,10 @@ const getDestination = () => { const ctx = getAudioContext(); if (!destination) { destination = ctx.createGain(); - destination.connect(ctx.destination); + var merger = ctx.createChannelMerger(ctx.destination.channelCount); + merger.connect(ctx.destination); + destination.connect(merger, 0, 4); + destination.connect(merger, 0, 5); } return destination; };