What is ElevenLabs?
ElevenLabs is a speech synthesis platform that offers high-quality, natural-sounding voices with configurable styles. It supports text-to-speech with multiple voices, making it a great fit for podcast narration, voiceovers, and audio content generation. For more information, visit elevenlabs.io.Starting with the Right Prompt
The initial prompt you give Mocha is crucial for getting your project started on the right track. When building an app that uses voice generation, you need to be specific about:- What text sources you accept: URLs, pasted text, or both
- Voice controls: Styles, tone, and any voice options you want available
- Audio output: Playback, download format, and storage
- UX expectations: Progress indicators, previews, and history
- Technical requirements: The voice API you want to use (ElevenLabs)
- A clear description of the app’s purpose and user flow
- Specific features broken down into bullet points
- Technical requirements (ElevenLabs)
- UX expectations (progress indicator, simple flow)
Setting up the ElevenLabs API Key
During the build, you should see a prompt to add a secret for the ElevenLabs API key. To get yourELEVENLABS_API_KEY key:
- Visit elevenlabs.io/app
- Sign in or create an account
- Open Developers and navigate to the API keys section.
- Create a new API key by clicking the Create API key button.
- We will be using the Text to Speech API key. It is more secure to restrict the key to only the features we will use.

Testing Voice Generation
Let’s try the voice generation on a Mocha blog post: Alternative Presentation Tools (PowerPoint).

Debugging Voice Generation Issues
The first thing I’ll do is explain to the AI exactly what I am doing and what I’m seeing. I try to give as much detail as possible. I also open the logs to see what is going on in the console.Prompt to the AI
I used the URL of the article to create the podcast. Using the blogpost located here: https://blog.getmocha.com/alternative-presentation-tools-powerpoint/I was able to successfully extract the text perfectly, but when I clicked on the generate button with the default “professional” setting, I saw the error: Failed to generate audio and then I looked at the console and the server responded with a 500 from the API.Please check if there is anything wrong with the code and fix any issues you find.


Wrapping up
In this guide, we walked through the process of setting up a Mocha app that generates podcast-style audio narrations using ElevenLabs text-to-speech models. We covered:- How to craft an effective initial prompt
- Setting up the ElevenLabs API key
- Debugging common voice generation issues

