chore(phase-0): stabilise foundation for Studio build

- Extract WAV assembly (buildWav, mergeFloat32Arrays, decodeFloat32Chunk,
  SAMPLE_RATE) into web/lib/audio/wav.ts so it can be reused by the
  Studio playback engine and library waveform previews
- Add server/waveform.py with compute_peaks() / write_peaks() — reads
  any WAV, mixes to mono, returns min/max peak arrays matching the
  WaveformPeaks TypeScript type
- Add server/ids.py with prefixed URL-safe ID helpers (gen_id, proj_id,
  asset_id, etc.) using stdlib secrets — no new dependency
- Add docs/studio-build-plan.md — full execution spec covering stack
  decisions, data models, API contract, component hierarchy, phase
  breakdown and acceptance criteria
- Ignore data/ directory (generated audio, waveforms, SQLite DB)
This commit is contained in:
2026-05-02 17:24:45 +01:00
parent 0236807928
commit 47e0c7e512
6 changed files with 1098 additions and 48 deletions
+35
View File
@@ -0,0 +1,35 @@
"""Stable, URL-safe ID generation for VibePod entities."""
import secrets
def _make_id(prefix: str) -> str:
return f"{prefix}_{secrets.token_urlsafe(8)}"
def gen_id() -> str:
return _make_id("gen")
def proj_id() -> str:
return _make_id("proj")
def asset_id() -> str:
return _make_id("asset")
def track_id() -> str:
return _make_id("track")
def clip_id() -> str:
return _make_id("clip")
def block_id() -> str:
return _make_id("block")
def take_id() -> str:
return _make_id("take")