diff --git a/bun.lockb b/bun.lockb index aece00d..2026279 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 7ee5804..33757fc 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "react": "^19.2.6", "react-dom": "^19.2.6", "sodium-native": "^4.3.2", + "tone": "^15.1.22", "ws": "^8.20.1", "zod": "^4.4.3" }, diff --git a/public/dashboard.js b/public/dashboard.js index 277bcc8..f756d99 100644 --- a/public/dashboard.js +++ b/public/dashboard.js @@ -493,6 +493,7 @@ const state = { const sampleRate = audioData.sampleRate; const frameCount = audioData.numberOfFrames; const numberOfChannels = audioData.numberOfChannels; + console.log(`AudioData: ${frameCount} frames, ${numberOfChannels} ch, ${sampleRate}Hz`); const audioBuffer = state.audioContextListen.createBuffer( numberOfChannels, frameCount, @@ -500,9 +501,8 @@ const state = { ); for (let ch = 0; ch < numberOfChannels; ch++) { const channelData = audioBuffer.getChannelData(ch); - const tempArray = new Float32Array(frameCount); - audioData.copyTo(tempArray, { planeIndex: ch }); - channelData.set(tempArray); + console.log(`Channel ${ch}: copyTo into ${channelData.length} samples`); + audioData.copyTo(channelData, { planeIndex: ch }); } const source = state.audioContextListen.createBufferSource(); source.buffer = audioBuffer;