Building Emo Narrator: Bringing Emotion to AI Voices - Eleven labs , AWS amplify , Next.Js , UI/UX

Building Emo Narrator: Bringing Emotion to AI Voices

I recently finished Emo Narrator, a full-stack Next.js application that uses ElevenLabs AI to turn plain text into emotionally charged narration. With a custom glassmorphism UI and an AWS Amplify backend, I let users choose between different voices and apply distinct emotional profiles to their speech. You can try the live app here: Emo Narrator.

The Technical Hurdle: Deploying Secrets on AWS Amplify

Every project has its “wall,” and for me it was the environment variable missing link. Local development was seamless, but once I deployed to AWS Amplify Hosting, the Next.js Server-Side Rendering (SSR) runtime wasn’t reliably picking up my ElevenLabs API key from the standard environment variable settings.

The "Secret Sauce" Fix:

I created a custom initialization script, inject-secrets.sh, which runs during the Amplify build phase. This script manually fetches the environment variable and writes it into a .env.production file:

#!/bin/bash

echo "Injected Secrets into .env.production"

echo "ELEVENLABS_API_KEY=$ELEVENLABS_API_KEY" >> .env.production

    

This ensures that my API route in /api/narrate always has the credentials it needs to communicate with the ElevenLabs servers in the deployed environment.

Tuning the Tones: Why the Weights Matter

To make the emotions feel real, I didn’t just guess values; I tuned the ElevenLabs voice_settings using three key parameters: stability, style, and similarity boost. Here’s how I think about the main presets:

  • Neutral (Stability: 0.75): High stability keeps the delivery consistent, calm, and professional for standard information.
  • Excited / Angry (Stability: 0.25, Style: 0.9): I drop stability significantly and push style close to max. That “unleashes” the model, letting it produce sharper tonal spikes and a wider expressive range that better matches high-intensity emotions.
  • Whisper (Stability: 0.4, Style: 1.0): I maximize style and pair it with about a 0.85x playback rate on the frontend, which stretches out the breathy qualities of the voice and creates an eerie, intimate atmosphere.

Voice Limitations

On the free tier, ElevenLabs limits how many active voices I can use concurrently. To stay within those constraints and still keep variety, I chose four versatile voices: Rachel, Dominic, Bella, and Antoni. Together they give a good balance of gender and character for different narration needs.

If you’d like to hear these emotional layers in action, you can experiment with the live app here: https://main.d11c506w0cprcx.amplifyapp.com/.