Pure HTML/CSS/JS frontend for Deepgram Flux streaming text-to-speech (v2 Speak).
This is the shared frontend for the *-flux-tts starter backends (Node, Java, Flask, FastAPI, Django). It is framework-agnostic — it only speaks the backend's HTTP + WebSocket contract, so any of those backends can serve it. Built with Vite and @deepgram/styles.
-
GET /api/session→{ "token": "<jwt>" } -
GET /api/metadata→ project metadata fromdeepgram.toml(title, description, repository) -
WS /api/tts?model=<flux-voice>&encoding=linear16&sample_rate=24000— authenticated with theaccess_token.<jwt>subprotocol. The client sends JSON control messages and receives binarylinear16audio frames plus JSON control messages:
pnpm install
pnpm dev # http://localhost:8080vite.config.js proxies /api (HTTP + WS) to http://localhost:8081 by default — start one of the *-flux-tts backends there. Override with VITE_BACKEND_URL.
As a submodule (how the starters consume it):
# inside a *-flux-tts starter
git submodule add https://github.com/deepgram-starters/flux-tts-html.git frontend
cd frontend && pnpm install && pnpm dev -- --port 8080pnpm build # outputs to dist/- Playback is
linear16at 24 kHz (SAMPLE_RATEinmain.js), matching thesample_ratesent on connect. Change both together if you use a different rate. - Flux voices use the format
flux-{voice}-{language}(e.g.flux-alexis-en).
MIT - See LICENSE