From b4a9f8ad59e5587de2aa1ccf06f38b2074ce5b8c Mon Sep 17 00:00:00 2001 From: Jonathan Baldie Date: Thu, 7 May 2026 20:43:30 +0100 Subject: [PATCH] test: harden Smart Speed worklet coverage --- SMART_SPEED_PHASE1_DESIGN.md | 262 ------------- client/cypress/fixtures/test-audio.wav | Bin 352878 -> 0 bytes .../tests/players/LocalAudioPlayer.cy.js | 105 ++---- .../tests/players/MediaPlayerContainer.cy.js | 351 ------------------ .../cypress/tests/players/SmartSpeedE2E.cy.js | 332 ++++------------- .../tests/players/SmartSpeedInit.cy.js | 96 ----- client/players/LocalAudioPlayer.js | 2 +- .../smart-speed/SilenceDetectorProcessor.js | 0 .../smart-speed/SilenceDetectorProcessor.js | 76 ++++ 9 files changed, 183 insertions(+), 1041 deletions(-) delete mode 100644 SMART_SPEED_PHASE1_DESIGN.md delete mode 100644 client/cypress/fixtures/test-audio.wav delete mode 100644 client/cypress/tests/players/MediaPlayerContainer.cy.js delete mode 100644 client/cypress/tests/players/SmartSpeedInit.cy.js rename client/{players => public}/smart-speed/SilenceDetectorProcessor.js (100%) create mode 100644 client/static/smart-speed/SilenceDetectorProcessor.js diff --git a/SMART_SPEED_PHASE1_DESIGN.md b/SMART_SPEED_PHASE1_DESIGN.md deleted file mode 100644 index 07b7c3e7..00000000 --- a/SMART_SPEED_PHASE1_DESIGN.md +++ /dev/null @@ -1,262 +0,0 @@ -# Smart Speed Phase 1 Design: Web Audio API Pipeline Refactor - -## Status -Work-in-progress for bead `audiobookshelf-hsc` (blocks `audiobookshelf-d8s`). - -## Objective -Refactor the local audio playback pipeline so that it can optionally route audio through the Web Audio API (AudioContext + MediaElementAudioSourceNode). This prepares the ground for Phase 2 (real-time silence detection) without changing audible behaviour when Smart Speed is OFF. - ---- - -## 1. Current Audio Pipeline Architecture - -### 1.1 Core Player Files -- **`client/players/LocalAudioPlayer.js`** — The single source of truth for local HTML5 audio playback. -- **`client/players/PlayerHandler.js`** — Mediates between the UI (`MediaPlayerContainer.vue`) and the concrete player (`LocalAudioPlayer` or `CastPlayer`). -- **`client/players/CastPlayer.js`** — Chromecast player; **out of scope** for this refactor. Smart Speed will only apply to `LocalAudioPlayer`. - -### 1.2 How Playback Currently Works - -`LocalAudioPlayer` creates a raw `