Audio Sidecar

The Python sidecar is an optional capability edge for Edge TTS and token-gated Freesound. The static editor remains usable without it, and the sidecar never owns project data or visual export. Production intent is to expose it only through the app’s same-origin /api/audio/ proxy while the service itself binds loopback at 127.0.0.1:52525. (docs/ARCHITECTURE.md:5-11, SVG-Animator-BIBLE.md:271-282)

Trust boundary

  • Configuration fails closed when the bind is not loopback or the public origin is unsafe.
  • Requests with an Origin must exactly match the configured public origin.
  • Provider routes require X-SVG-Animator-Request: 1; health, readiness, and capabilities are exempt from that marker.
  • Freesound credentials stay server-side.
  • Concurrency, request rates, provider timeouts, and response sizes are bounded. (audio-service/__main__.py:309-335, audio-service/config.py:17-29, audio-service/config.py:74-97)

Capability truth

health reports process liveness only. ready probes providers and returns 200 only when Edge is available, otherwise 503 with degraded state. capabilities reports Edge and Freesound independently. Probe results are cached and concurrent probes are coalesced, so provider state is explicit without turning every UI refresh into provider traffic. (audio-service/__main__.py:338-396)

Audio synthesis and previews are interactive capabilities. They may populate the bounded browser cache and participate in playback, but they do not alter the deterministic, audio-free SVG output. (asset-cache.js:72-99, docs/ARCHITECTURE.md:73-75)