feat(06-02): add feature extraction and segmentation backend modules + API
- Create lightsync/audio/features.py with extract_features and extract_features_async - Create lightsync/audio/segments.py with detect_segments via agglomerative clustering - Add /api/audio/segments and /api/audio/features endpoints to audio.py - Initialize app.state.segments cache in main.py lifespan
This commit is contained in:
@@ -25,6 +25,8 @@ async def lifespan(app: FastAPI):
|
||||
|
||||
# Beat analysis cache: filepath -> {"tempo": float, "beats": [float, ...]}
|
||||
app.state.beats = {}
|
||||
# Segments cache: "filepath:n_segments" -> [{start, end, label}, ...]
|
||||
app.state.segments = {}
|
||||
|
||||
# UDP sender for device communication (Phase 3)
|
||||
udp_sender = UDPSender()
|
||||
|
||||
Reference in New Issue
Block a user