diff --git a/server.py b/server.py index d73ea07..61db4d1 100644 --- a/server.py +++ b/server.py @@ -23,7 +23,7 @@ prompts = [ ] -model = modal.Cls.lookup("infinifi", "Model") +# model = modal.Cls.lookup("infinifi", "Model") @asynccontextmanager @@ -75,7 +75,7 @@ def advance(): else: current_index = current_index + 1 - threading.Thread(target=generate_new_audio).start() + # threading.Thread(target=generate_new_audio).start() t = threading.Timer(60, advance) t.start() diff --git a/web/script.js b/web/script.js index f1d761d..a1a4740 100644 --- a/web/script.js +++ b/web/script.js @@ -1,5 +1,7 @@ const playBtn = document.getElementById("play-btn"); const catImg = document.getElementsByClassName("cat")[0]; +const clickAudio = new Audio("/audio/click.wav"); +const clickReleaseAudio = new Audio("/audio/click-release.wav"); const CROSSFADE_DURATION_MS = 5000; const CROSSFADE_INTERVAL_MS = 20; @@ -81,6 +83,17 @@ function animateCat() { }, 500); } +playBtn.onmousedown = () => { + clickAudio.play(); + document.addEventListener( + "mouseup", + () => { + clickReleaseAudio.play(); + }, + { once: true }, + ); +}; + playBtn.onclick = () => { if (isPlaying) { pauseAudio();