From c5ac9e1a3bdff218ddf8b112cfe90402100ad767 Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Fri, 5 Jun 2026 09:17:53 -0400 Subject: [PATCH] =?UTF-8?q?zebra-spaces:=20dial=20the=20worklet=20stretch?= =?UTF-8?q?=20cap=20from=20=C2=B18%=20to=20=C2=B16%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gentler pitch shift during buffer adaptation at the cost of slightly longer ramp time: - Shrink 4s→2s: ~25s → ~31s - Grow 0.5s→4s: ~47s → ~61s Pitch shift drops from ≤1 semitone to ≤0.7 semitone — less perceptible on music. Fox 2026-06-05 dial. --- web/zebra-spaces.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/web/zebra-spaces.html b/web/zebra-spaces.html index de02a8e..f708c4e 100644 --- a/web/zebra-spaces.html +++ b/web/zebra-spaces.html @@ -1775,7 +1775,7 @@ const JITTER_BUFFER_WORKLET_CODE = ` * - buffered > target → stretchFactor < 1.0 (fast playback → buffer shrinks) * - buffered ≈ target → stretchFactor = 1.0 (normal) * - * Rate change is capped at ±8% and ramped smoothly per-block so the + * Rate change is capped at ±6% and ramped smoothly per-block so the * pitch shift during adaptation is ≤1 semitone, brief, and centred. * Listeners can disable stretching entirely via the 'lock_rate' command * so music never gets resampled. @@ -1800,8 +1800,8 @@ class JitterBufferProcessor extends AudioWorkletProcessor { this.stretchFactor = 1.0; this.targetStretch = 1.0; this.stretchRampPerBlock = 0.0002; /* ~0.075/sec ramp */ - this.maxStretch = 1.08; /* cap rate at ±8% */ - this.minStretch = 0.92; + this.maxStretch = 1.06; /* cap rate at ±6% */ + this.minStretch = 0.94; this.bufferedReportEvery = 256; this.bufferedReportCounter = 0; this.queue = []; @@ -1998,7 +1998,7 @@ function installJitterBuffer(uuid, node){ }; /* All roles now allow time-stretching — listeners benefit too * (their 4s cushion shrinks toward 2s when feed is clean, grows - * back to 4s on instability). The ±8% rate cap means the brief + * back to 4s on instability). The ±6% rate cap means the brief * pitch shift during adaptation is ≤1 semitone — barely audible * on speech, briefly audible on sustained music tones. Fox * 2026-06-05: "the 4 sec delay doesn't get faster with a better @@ -2160,7 +2160,7 @@ async function refreshLipSyncForUuid(uuid){ * is hitting the listener with loss/jitter, we GROW the worklet's * target buffer depth from DD_BASE_TARGET (0.5s, conversational) up * toward DD_MAX_TARGET (4s, full wiggle cushion). The worklet's - * built-in adaptive resampling (±8% rate cap) slowly stretches + * built-in adaptive resampling (±6% rate cap) slowly stretches * playback to grow the actual buffer toward the new target without * audible click or gap — pitch shifts by ≤1 semitone during the * adaptation, returns to normal once the target is reached. @@ -2601,7 +2601,7 @@ const RECV_PLAYOUT_DELAY_SEC = 4.0; * latency, then the Double Dragon adaptive controller grows it to * DD_MAX_TARGET_SEC (4s) when the publisher's network or encoder * shows instability and shrinks it back to DD_BASE_TARGET_SEC (0.5s) - * during sustained clean periods. The worklet's ±8% rate-limited + * during sustained clean periods. The worklet's ±6% rate-limited * resampling makes the transition smooth: brief ≤1 semitone pitch * shift during the ramp, silence-free, click-free. */ const SPEAKER_PLAYOUT_DELAY_SEC = 0.5; @@ -6798,8 +6798,8 @@ logLine('', 'ready — pick a handle, type a rendezvous code, enter the space');