A simple web app that lets you:
- Text → Speech (TTS): turn text into audio using Google Labs (LLL) Text-to-Speech.
- Speech → Text (STT): transcribe audio using Chutes Whisper.
This is a Next.js app that runs locally (Node.js) and can be deployed to Cloudflare Workers using OpenNext.
- Node.js 18+ (recommended)
- pnpm (recommended) or npm
pnpm installSpeech-to-text requires a Chutes API token.
Create a file called .env.local in the project root:
CHUTES_API_TOKEN=your_token_hereIf you don’t set this, POST /api/stt will return: CHUTES_API_TOKEN not configured.
pnpm devOpen:
Server route that forwards to Google Labs TTS.
Request body:
{
"text": "Hello world",
"languageCode": "en-US",
"voiceName": "..."
}Response:
- JSON containing the audio result (base64), as returned by Google Labs.
Server route that forwards to Chutes Whisper.
Request body:
{
"audio_b64": "<base64 audio>"
}Response:
- plain text transcription
This repo includes a dev-focused Docker setup.
docker compose up --buildOpen:
Note: you still need to provide CHUTES_API_TOKEN to the container (for example via an env file or compose environment settings).
This project uses OpenNext for Cloudflare.
Build + deploy:
pnpm deployPreview with Cloudflare tooling:
pnpm previewpnpm dev– run the app locallypnpm build– build the apppnpm deploy– build + deploy to Cloudflarepnpm preview– build + preview on Cloudflarepnpm cf-typegen– generate Cloudflare env types