From 65fa255699685c5cb8c8dc536070bf40180e2043 Mon Sep 17 00:00:00 2001 From: Jeff Kaufman Date: Sun, 3 Jan 2021 14:39:32 +0000 Subject: [PATCH] audio offset: Start users at bucket six (DELAY_INTERVAL * LAYERING_DEPTH), and not the end of the buffer (115) --- html/index.html | 3 ++- server.py | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/html/index.html b/html/index.html index bb42e77..5c77e11 100644 --- a/html/index.html +++ b/html/index.html @@ -859,7 +859,8 @@

Lyrics

-
Offset:
+ +
Offset:
Users: ...
diff --git a/server.py b/server.py index 1dba691..a89cd96 100755 --- a/server.py +++ b/server.py @@ -111,10 +111,12 @@ def reset(self): # Leave this much space between users. Ideally this would be very # short, but it needs to be long enough to cover "client total time # consumed" or else people won't all hear each other. -DELAY_INTERVAL = 3 # 3s; keep in sync with demo.js:DELAY_INTERVAL +DELAY_INTERVAL = 3 # 3s; keep in sync with demo.js:DELAY_INTERVAL and + # index.html:audioOffset # How many links to use for the chain of users before starting to double up. -LAYERING_DEPTH = 6 # keep in sync with demo.js:N_BUCKETS +LAYERING_DEPTH = 6 # keep in sync with demo.js:N_BUCKETS and + # index.html:audioOffset # If we have not heard from a user in N seconds, forget all about them. USER_LIFETIME_SAMPLES = SAMPLE_RATE * 60 * 60 # 1hr @@ -492,6 +494,7 @@ def update_users(userid, username, server_clock, client_read_clock) -> None: delay_samples = server_clock - client_read_clock if userid not in users: users[userid] = User(userid, username, server_clock, delay_samples) + users[userid_lead].send("delay_seconds", state.first_bucket) if ENABLE_TWILIO: users[userid].allocate_twilio_token()