From d52eead4913f838defaea4bae2131cff729bc6e2 Mon Sep 17 00:00:00 2001 From: fan-droide Date: Mon, 11 Sep 2023 11:36:28 +0200 Subject: [PATCH 1/3] update readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index e72a431..c105986 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,7 @@ The test emits a beep using device speakers that it listens for on the device's ## Homepage (with latency data) https://superpowered.com/webbrowserlatency + +## Run it locally + +`python3 -m http.server` \ No newline at end of file From 29bb71095396bb444fcad2d1f9294ab38b3bd242 Mon Sep 17 00:00:00 2001 From: fan-droide Date: Tue, 12 Sep 2023 09:53:39 +0200 Subject: [PATCH 2/3] fix for firefox --- latencyMeasurer.js | 5 +++++ processor.js | 1 + 2 files changed, 6 insertions(+) diff --git a/latencyMeasurer.js b/latencyMeasurer.js index f2d2460..67e2356 100644 --- a/latencyMeasurer.js +++ b/latencyMeasurer.js @@ -43,6 +43,11 @@ class latencyMeasurer { } processInput(left, right, _samplerate, numberOfSamples) { + // Possible fix for Firefox + /*if (!left || !right) { + console.error("Undefined buffers received:", { left, right }); + return; + }*/ this.rampdec = -1.0; this.samplerate = _samplerate; this.buffersize = numberOfSamples; diff --git a/processor.js b/processor.js index ca782fc..1ca73e9 100644 --- a/processor.js +++ b/processor.js @@ -11,6 +11,7 @@ class MyProcessor extends AudioWorkletProcessor { } process(inputs, outputs, parameters) { + if(!inputs[0].length) return let inBufferL = null, inBufferR = null, outBufferL = null, outBufferR = null; if (typeof inputs.getChannelData === 'function') { inBufferL = inputs.getChannelData(0); From 0cc70af40ee2b199389367e26a00476b6847a2a1 Mon Sep 17 00:00:00 2001 From: fan-droide Date: Fri, 29 Mar 2024 17:28:36 +0100 Subject: [PATCH 3/3] avoid long beep when temporary noise is detected --- latencyMeasurer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/latencyMeasurer.js b/latencyMeasurer.js index 67e2356..fe27c07 100644 --- a/latencyMeasurer.js +++ b/latencyMeasurer.js @@ -124,6 +124,7 @@ class latencyMeasurer { this.rampdec = 1.0 / numberOfSamples; this.measurementState = this.nextMeasurementState = measurementStates.waiting; this.latencyMs = -1; + this.samplesElapsed = 0; } } break;