Prerequisites
Before you begin, make sure you have the following:Node.js 20.9 or later
Download from nodejs.org or use a version manager like
nvm.Prisma Postgres Database
Sign up for a free database at Prisma Data Platform. You’ll need the connection string.
Any PostgreSQL database will work - Prisma Postgres is recommended for its simplicity.
Clerk Account (with Organizations enabled)
Create an account at clerk.com and enable Organizations in your application settings.
Cloudflare R2 Bucket
Set up a bucket at Cloudflare R2. The free tier includes 10GB storage.
Modal Account
Sign up at modal.com for serverless GPU hosting. Install the CLI:
Polar Account (Optional)
For billing features, create an account at polar.sh. Use sandbox mode for testing.
Installation
Configure environment variables
Create a
.env.local file in the root directory with the following variables:.env.local
Deploy the TTS Engine
The TTS engine runs on Modal’s serverless GPU infrastructure. You need to deploy it before the web app can generate audio.Configure R2 credentials in chatterbox_tts.py
Open
chatterbox_tts.py and update the R2 configuration:chatterbox_tts.py
Create Modal secrets
Create the required secrets in your Modal dashboard:
Or create them via CLI:
| Secret Name | Keys | Description |
|---|---|---|
cloudflare-r2 | AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY | R2 API credentials |
chatterbox-api-key | CHATTERBOX_API_KEY | API key to protect the endpoint (use any strong random string) |
hf-token | HF_TOKEN | Hugging Face token for downloading model weights |
Deploy to Modal
CHATTERBOX_API_URL in your .env.local.The first request after inactivity may take 10-15 seconds due to cold starts as Modal provisions the GPU container.
Seed System Voices
Resonance includes 20 pre-built voices across different categories and locales. Seed them to your database and R2 bucket:The seed script creates voices in categories like Audiobook, Conversational, Narrative, Characters, Meditation, Podcast, Advertising, Voiceover, and Corporate.
Run the Application
Start the development server:Sign up and create an organization
Create a new account and set up your first organization. All voices and generations are scoped to organizations.
Generate your first audio
Navigate to the Text-to-Speech page, select a voice, enter some text, and click Generate. Your audio will be created in seconds!
Testing with Sandbox Mode
To test billing features without real payments, use Polar’s sandbox mode:- Set
POLAR_SERVER="sandbox"in your.env.local - Use the test card number
4242 4242 4242 4242with any future expiration date and any CVC - All charges will be simulated - no real money will be processed
Available Scripts
| Command | Description |
|---|---|
npm run dev | Start development server on port 3000 |
npm run build | Create production build |
npm run start | Start production server |
npm run lint | Run ESLint |
npm run sync-api | Regenerate Chatterbox API types from OpenAPI spec |
Next Steps
Architecture
Learn how Resonance works under the hood
Self-Hosting
Deploy Resonance to production
API Reference
Explore the tRPC API endpoints
Configuration
Customize Resonance for your needs