From 49c31e227105045509ce2f1b3ff2a4647afc2606 Mon Sep 17 00:00:00 2001 From: Vincent Rubinetti Date: Tue, 10 Dec 2024 21:20:56 -0500 Subject: [PATCH 1/2] Fix dictaphone buffer length --- media/web-dictaphone/scripts/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/web-dictaphone/scripts/app.js b/media/web-dictaphone/scripts/app.js index 49cb2464..2360b0cd 100644 --- a/media/web-dictaphone/scripts/app.js +++ b/media/web-dictaphone/scripts/app.js @@ -119,7 +119,7 @@ function visualize(stream) { const analyser = audioCtx.createAnalyser(); analyser.fftSize = 2048; - const bufferLength = analyser.frequencyBinCount; + const bufferLength = analyser.fftSize; const dataArray = new Uint8Array(bufferLength); source.connect(analyser); From 33e85e628d64c016dd663977089403939b22985a Mon Sep 17 00:00:00 2001 From: Vincent Rubinetti Date: Wed, 11 Dec 2024 11:07:47 -0500 Subject: [PATCH 2/2] incorporate review --- media/web-dictaphone/scripts/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/media/web-dictaphone/scripts/app.js b/media/web-dictaphone/scripts/app.js index 2360b0cd..82abd3b2 100644 --- a/media/web-dictaphone/scripts/app.js +++ b/media/web-dictaphone/scripts/app.js @@ -117,9 +117,9 @@ function visualize(stream) { const source = audioCtx.createMediaStreamSource(stream); + const bufferLength = 2048; const analyser = audioCtx.createAnalyser(); - analyser.fftSize = 2048; - const bufferLength = analyser.fftSize; + analyser.fftSize = bufferLength; const dataArray = new Uint8Array(bufferLength); source.connect(analyser);