How to Generate Voice-Over for Online Courses with TTS API?

By CourseVoice editorial team · Updated 2026-11-19

This guide shows course creators how to turn lesson scripts into professional audio files using the EduEcho TTS API. You will learn to generate voice-overs for online courses by sending text to our endpoint and receiving audio files programmatically. We cover practical steps for integrating with LMS platforms, managing costs, and handling multi-language content without hiring voice actors.

Designed for startups building online education platforms, this page provides concrete workflows for automating audio production. You will see exactly how to choose voices, split long scripts, and handle API responses. The instructions focus on specific technical details like character limits, rate limits, and USDT top-ups, ensuring you can scale your content library efficiently.

How to Generate Voice-Over for Online Courses with TTS API?

Frequently asked questions

What is a TTS API?

A cloud text-to-speech API lets you send text and receive an audio file via a simple POST request. It uses the same request shape as the OpenAI speech endpoint, so you can use official OpenAI SDKs by changing the base URL. This simplifies converting lesson scripts into audio files programmatically for your online courses.

How do I choose the right voice for my course?

Choose from eight presets based on your content style. Use aria for warm narration, nova for upbeat lessons, luna for storytelling, or sage for instructional content. For male voices, try felix for energetic promos, milo for conversational tones, atlas for neutral news-style delivery, or orion for deep documentary styles. Each voice supports all 23 languages.

Can I generate audio for long courses?

Yes. Split your text into parts of up to 4096 characters and join the resulting audio files. Typical speed is roughly real time (25 characters per second). Requests are processed sequentially, so under load, a request may wait in a queue before synthesis begins.

How does the API handle different languages?

The API supports 23 languages, including English, Spanish, German, and Japanese. Any voice can speak any supported language. If you do not set the language parameter, it is guessed from the script, but for non-English Latin text, you should explicitly set the language code.

What is the character limit per request?

Each request accepts up to 4096 characters of input text. Spaces and punctuation count toward this limit. For longer course content, you must split the text into chunks of 4096 characters or less and combine the generated audio files afterward.

How do I integrate the API with my LMS?

Send a POST request to https://api.api36.info/v1/audio/speech with your text and authentication header. Use the OpenAI SDK by setting the base URL to https://api.api36.info/v1. Pass your API key as a Bearer token in the Authorization header to generate audio files programmatically.

Is the audio quality suitable for professional courses?

The voices are based on licensed recordings from LibriTTS-R and LibriVox public-domain audiobook readings. The audio is clear and professional, suitable for educational content. Every generated file carries an inaudible watermark marking it as synthetic speech, ensuring transparency without affecting listening quality.

How much does it cost to generate 1 hour of audio?

Pricing is $10 per 1 million characters. Since typical speed is roughly real time, one hour of audio requires approximately 90,000 characters (60 minutes * 60 seconds * 25 characters). This costs about $0.90. Failed requests are free, so you only pay for successful generations.

Can I use the API for video content?

Yes, you can generate audio files to sync with video content. The API returns audio in formats like mp3, wav, opus, flac, or pcm. You can adjust the speed between 0.25 and 4.0 to match your video timeline precisely.

What happens if the API is down?

We do not offer an SLA or uptime guarantee. Requests are processed sequentially, so under load, a request may wait in a queue. If synthesis fails, the charge is returned in full. Support is available by email only.

Do I need a developer to use the API?

A developer is helpful for integration, but the API is designed for simplicity. You can use the official OpenAI SDK by changing the base URL. The /get-api-key/ page provides a ready curl example, making it accessible for technical teams to implement quickly.

Can I change the voice after generation?

No, the voice is determined at the time of the request. Once the audio file is generated, the voice is fixed. To use a different voice, you must send a new request with the desired voice parameter and pay for the additional characters.

How do I track my API usage?

The /get-api-key/ page displays your balance, characters left, and usage history. Request metadata, including time, characters, and status, is kept for billing purposes. You can monitor your consumption directly from your account dashboard to manage your budget effectively.

Is the audio watermarked?

Yes, every generated file carries an inaudible watermark that marks it as synthetic speech. This watermark identifies the audio as AI-generated without affecting the listening experience or quality of your course content.

Why Use TTS for Course Content

Sound wave illustration for: Why Use TTS for Course Content

Text-to-speech allows you to convert lesson scripts into audio files programmatically. This approach ensures consistent narration quality across your entire curriculum without relying on multiple voice actors. You maintain a uniform brand voice, which helps learners focus on the material rather than adjusting to different speaking styles in every module.

Consistency Across Lessons

Using the same voice preset for all modules creates a cohesive learning experience. Whether a student takes Module 1 or Module 10, they hear the same tone and pacing. This reduces cognitive load and makes the course feel professionally produced, even when content is created by different instructors.

Reduced Production Time

Generating audio via API is significantly faster than booking studios. You can produce hours of content in minutes by splitting long scripts into 4096-character chunks. This speed allows you to update course material quickly when information changes, without re-recording entire sessions.

Global Reach with Languages

You can offer courses in 23 languages, including English, Spanish, German, and Japanese. Each voice can speak any supported language, allowing you to localize content efficiently. This enables you to reach international audiences without hiring native speakers for every language variant.

Step 1: Choose Your Voice

Sound wave illustration for: Step 1: Choose Your Voice

Selecting the right voice is the first step in creating consistent course audio. EduEcho provides eight distinct presets, each designed for specific teaching styles. You can choose between female and male voices to match your brand’s tone.

Matching the voice to the content ensures learners stay engaged. Whether you need a calm instructor for complex topics or an energetic host for quizzes, the right preset makes a difference in how students perceive your material.

Select from 8 Presets

The API offers eight voice options, including female voices like Aria and Nova, and male voices like Felix and Milo. Each voice has a distinct character, from warm narrators to upbeat presenters.

You can mix voices across different lessons to keep content fresh. For example, use Atlas for news-style updates and Luna for storytelling segments. This variety helps maintain student interest throughout the course.

  • Aria: warm, clear narrator
  • Nova: bright, upbeat
  • Luna: soft, storytelling
  • Sage: calm, instructional
  • Felix: energetic, promo
  • Milo: friendly, conversational
  • Atlas: neutral, news
  • Orion: deep, documentary

Match Tone to Content

Align the voice personality with your lesson type. Use Sage for instructional modules where clarity is key, or Orion for documentary-style deep dives. Consistent tone helps learners recognize the context of each segment.

Avoid mismatching voice and content, such as using an energetic voice for a serious historical lecture. The right pairing enhances comprehension and retention by reinforcing the emotional context of the lesson.

Test Different Voices

Generate short audio samples for each voice using your test credit. Evaluate how each voice sounds with your specific script content. This helps you identify the best fit before scaling production.

Record a few sentences from your course material and listen critically. Consider factors like pacing and clarity. Adjust your choice based on feedback from a small group of test learners.

Step 2: Prepare Your Text

Sound wave illustration for: Step 2: Prepare Your Text

Before sending text to the API, ensure each request stays within the 4096-character limit. This constraint applies to every individual call, so breaking down long lesson scripts is necessary for comprehensive courses. Spaces and punctuation count toward this total, so plan your splitting strategy accordingly to avoid truncation or errors during synthesis.

If a script exceeds the limit, split it into smaller parts, generate audio for each, and join the resulting files. This ensures complete coverage of your content without hitting the character ceiling. Always verify that the text segments are logically separated to maintain clear audio transitions.

Keep Under 4096 Characters

The API accepts a maximum of 4096 characters per request. This limit includes all spaces, punctuation, and special characters in your input text. Staying within this boundary prevents request failures and ensures consistent processing speeds, which typically handle about 25 characters of text per second of generated audio.

Exceeding this limit will result in an error. To manage this, measure your script length before making the API call. If your lesson text is too long, divide it into logical segments, such as individual paragraphs or sections, to stay within the allowed character count.

  • Count spaces and punctuation as characters.
  • Measure text length before each API call.
  • Stay under 4096 characters per request.

Split Long Scripts

For longer lessons, divide the text into chunks of up to 4096 characters. Generate audio for each chunk separately using the API, then join the resulting audio files. This approach maintains audio quality and ensures all content is converted without data loss.

When splitting, choose natural break points like paragraph ends or section transitions. This helps preserve the narrative flow and makes the final audio file sound cohesive. Use standard audio editing tools or scripts to concatenate the files seamlessly.

  • Divide text into 4096-character segments.
  • Generate audio for each segment.
  • Join files to create final audio.

Check Language Codes

The API supports 23 languages, including English, Spanish, German, French, Chinese, and Japanese. If you do not specify a language, the system guesses it from the text script. For non-English text using Latin script, such as German or Spanish, explicitly set the language parameter to ensure accurate pronunciation.

Using the correct ISO language code improves synthesis accuracy, especially for languages with similar scripts. For example, setting language: "de" for German text prevents the system from defaulting to English. This is crucial for maintaining clarity in multi-language courses.

  • Supports 23 languages including Arabic, Chinese, and Swahili.
  • Explicitly set language for non-English Latin text.
  • Guesses language if parameter is omitted.

Step 3: Make the API Request

Sound wave illustration for: Step 3: Make the API Request

Once your script is prepared, send a POST request to https://api.api36.info/v1/audio/speech. The API processes the text synchronously, returning the audio file directly in the response. You do not need to wait for asynchronous notifications or poll for completion.

This immediate delivery allows you to process the audio without waiting for asynchronous notifications. You can immediately save the file or pipe it into your LMS workflow.

Use Curl or SDK

The endpoint follows the same request shape as the OpenAI speech endpoint. You can use the official OpenAI SDK by changing the base_url to https://api.api36.info/v1, or use plain HTTP.

A simple curl example: `curl -X POST https://api.api36.info/v1/audio/speech -H "Authorization: Bearer tts-..." -d '{"model":"tts-1","input":"Hello","voice":"nova","response_format":"mp3"}'`

  • Use OpenAI SDK with custom base_url
  • Use standard HTTP POST requests
  • Supports JSON body parameters

Set Authentication

Include your API key in the header: Authorization: Bearer tts-.... Each account has one active key, which can be rotated if needed.

Ensure your key is valid before making requests to avoid unnecessary character charges.

  • Header: Authorization: Bearer tts-...

Specify Audio Format

Choose your preferred format in the response_format field: mp3, wav, opus, flac, or pcm. MP3 is suitable for most web players, while WAV offers lossless quality for editing.

The API returns the audio file directly in the response body, ready for download or storage.

  • mp3, wav, opus, flac, pcm

Step 4: Handle the Response

Sound wave illustration for: Step 4: Handle the Response

The API returns the synthesized audio file directly in the response body. You receive a single binary file that matches the requested format, such as MP3 or WAV, containing the complete spoken lesson segment. This immediate delivery allows you to process the audio without waiting for asynchronous notifications.

Receive Audio File

Upon successful synthesis, the response contains the audio data. Ensure your code handles binary streams correctly to avoid corruption. The file size depends on the text length and chosen format; for example, MP3 files are smaller and easier to transfer than uncompressed WAV files.

  • Supports MP3, WAV, OPUS, FLAC, and PCM formats
  • Files are returned immediately upon successful synthesis
  • Failed requests return no audio and are free

Save to Storage

Store the received audio file in your cloud storage provider, such as AWS S3 or Google Cloud Storage. This ensures reliable hosting for your students and reduces bandwidth costs by leveraging dedicated content delivery networks. Avoid storing large audio files directly in your database to maintain performance.

  • Use object storage for scalability
  • Implement versioning to handle script updates
  • Consider CDN integration for faster global access

Link to Lesson

Update your course metadata to associate the new audio file with the corresponding lesson. Update the lesson’s audio URL in your LMS database so students can access the voice-over seamlessly. This step completes the workflow, making the content ready for immediate student consumption.

  • Update lesson metadata with audio URL
  • Ensure audio matches the correct lesson ID
  • Test playback before publishing to students

Step 5: Integrate with LMS

Sound wave illustration for: Step 5: Integrate with LMS

Generating audio for every lesson manually adds unnecessary steps to your content pipeline. By connecting your LMS to the TTS API, you turn text files into audio files automatically, ensuring every new module has a voice-over ready for students.

Automate Audio Generation

Use scheduled jobs to send lesson scripts to the API endpoint. The system processes the text and returns an audio file, which you can save directly to your media library without manual intervention.

  • Use webhooks or scheduled jobs to send lesson scripts to the API endpoint.
  • Process text and return audio files automatically.
  • Save generated files directly to your media library.

Trigger on Content Update

Configure your LMS to detect when a lesson script is saved or modified. The integration should immediately trigger a synthesis request, ensuring that updated content always has the latest voice-over version available for learners.

  • Detect when a lesson script is saved or modified.
  • Immediately trigger a synthesis request upon update.
  • Ensure the latest voice-over is always available.

Streamline Workflow

Link the generated audio URL to the lesson metadata in your LMS. This creates a seamless experience where students can listen to the content directly from the course player, reducing the need for separate audio uploads and management.

  • Link generated audio URLs to lesson metadata.
  • Create a seamless experience for students.
  • Reduce separate audio uploads and management tasks.

Step 6: Manage Costs

Sound wave illustration for: Step 6: Manage Costs

Managing your API costs is straightforward because billing is based on character count rather than seconds of audio. You pay $0.01 per 1,000 characters, including spaces and punctuation, making it easy to predict expenses for your course scripts. Failed requests are free, so you only pay for successful audio generation.

Monitor Character Usage

Your dashboard on /get-api-key/ displays your current balance and characters remaining. Since the free trial provides $0.50 (about 50,000 characters), you can test multiple lessons before committing to a top-up. Track your usage to ensure you do not exceed your budget during content production.

  • Cost: $10 per 1 million characters
  • Spaces and punctuation count as characters
  • Failed requests are free

Top Up with USDT

Add funds using USDT on the TRON network (TRC-20). There is a minimum top-up amount of $5, and credits are automatically added to your account within minutes. Balance does not expire, allowing you to build a reserve for future course batches.

No credit cards, PayPal, or subscriptions are required. This method keeps administrative overhead low for startups managing multiple API keys or accounts.

  • Currency: USDT on TRON (TRC-20)
  • Minimum top-up: $5
  • Processing time: Within minutes

Track Failed Requests

If synthesis fails, the charge is returned in full. You can verify this by checking your request history and billing logs. This ensures you are not penalized for temporary network issues or invalid input parameters during bulk generation.

  • Refunds are automatic for failed requests
  • Check dashboard for status codes
  • No hidden fees for retries
Step 6: Manage Costs

Step 7: Optimize Audio Quality

Sound wave illustration for: Step 7: Optimize Audio Quality

Fine-tuning audio parameters ensures your course voice-overs sound natural and professional. By adjusting speed and selecting the appropriate audio format, you can optimize both listening experience and file sizes for your students.

Adjust Speed Settings

The API accepts a speed parameter between 0.25 and 4.0. Use slower speeds for complex educational material to aid comprehension, or faster rates for quick reviews. Adjustments help match the narrator's pace to your specific content style without distorting the voice.

Choose Right Format

Select mp3 for web playback or wav and flac for high-fidelity archival. The opus format offers excellent compression for modern players, while pcm provides raw data for custom processing. Choose based on your LMS playback capabilities.

  • MP3: Best for general web playback
  • WAV/FLAC: High quality for archival
  • Opus: Efficient compression for modern browsers

Review Output Files

Always listen to generated samples to verify clarity, especially after changing speed or format. Check that the audio flows correctly when joined from multiple 4096-character segments. This step ensures consistent quality across your entire course library.

Step 8: Scale Your Content

Sound wave illustration for: Step 8: Scale Your Content

Scaling course production requires moving from manual scripting to automated generation pipelines. By leveraging the API’s 4,096-character limit per request, you can convert entire lesson scripts into audio files programmatically, ensuring consistent voice-overs across hundreds of modules without re-hiring voice talent for each update.

Generate Bulk Lessons

Process multiple scripts in parallel or sequence to build your library quickly. Since requests are processed one after another, plan your batch sizes to stay within the 60 requests per minute rate limit. This ensures steady throughput without exceeding your API key’s capacity.

  • Automate script-to-audio conversion via your LMS backend.
  • Use the OpenAI SDK with a custom base URL for easy integration.

Handle High Volume

Long texts must be split into parts of up to 4096 characters and joined afterward. This approach prevents token limits while maintaining audio continuity. For short phrases, expect a few seconds of generation time; longer texts typically process at roughly real-time speed.

Under heavy load, requests may queue. Monitor your usage dashboard to adjust generation timing during peak hours, ensuring your course updates are ready when learners need them.

  • Split scripts >4096 chars into segments.
  • Join audio segments programmatically after synthesis.

Maintain Quality

Consistency is key for professional courses. Stick to one voice preset per course series to maintain a uniform learner experience. Use the speed parameter (0.25–4.0) to adjust pacing for complex topics without distorting the voice’s natural tone.

Review generated audio files before publishing. Since generated audio is returned in the response and not stored, you can re-generate specific segments if needed, ensuring every lesson meets your quality standards before linking to the LMS.

  • Select a single voice for course consistency.
  • Adjust speed (0.25–4.0) for clarity.

Step 9: Handle Multi-Language Courses

Sound wave illustration for: Step 9: Handle Multi-Language Courses

Multi-language support allows you to reach global learners without hiring multiple voice actors. The API handles language detection automatically, but explicit settings ensure accuracy for ambiguous scripts.

Detect Language Automatically

The API guesses the language from the script's script (e.g., Latin defaults to English). This works well for single-language courses but may fail if text mixes languages or uses non-standard characters.

Set Language Explicitly

Always set the language field with an ISO code for non-English Latin text. This prevents misinterpretation and ensures the correct voice preset applies, maintaining consistent tone across lessons.

  • Use language field for clarity.
  • Prevents default English fallback.
  • Ensures correct voice behavior.

Support 23 Languages

Supports Arabic, Chinese, Danish, Dutch, English, Finnish, French, German, Greek, Hebrew, Hindi, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese, Russian, Spanish, Swahili, Swedish, and Turkish. Any voice can speak any of these languages, allowing uniform production standards.

  • 23 supported languages.
  • All voices speak all languages.
  • No extra voice licenses needed.

Step 10: Troubleshoot Common Issues

Sound wave illustration for: Step 10: Troubleshoot Common Issues

Debugging your TTS integration starts with understanding why a request might fail. Most issues stem from authentication errors, rate limits, or malformed requests. By systematically checking these areas, you can resolve issues quickly and keep your course audio pipeline running smoothly.

Check Rate Limits

Your API key allows 60 requests per minute once funded. If you exceed this, new requests will queue or fail. Monitor your usage dashboard to stay within limits, especially when generating bulk lessons.

Verify API Key

Ensure your Authorization: Bearer header contains the correct key. Keys are single-use; issuing a new key immediately invalidates the old one. Double-check that you are using the key for the correct site domain.

Review Error Messages

HTTP status codes indicate the specific failure. A 400 error usually means invalid parameters like an unsupported voice or format. A 500 error suggests a server-side issue. Always log these codes to identify recurring patterns.

Step 11: Ensure Accessibility

Sound wave illustration for: Step 11: Ensure Accessibility

Generating audio files programmatically allows you to pair high-quality voice-overs with your text-based lessons, supporting visual learners who benefit from dual coding. Since the API returns standard audio formats like MP3 or WAV, these files integrate seamlessly with any LMS that supports standard HTML5 audio players, ensuring broad compatibility.

Audio for Visual Learners

By converting lesson scripts into audio, you provide an alternative consumption method that reinforces learning. Students can listen to course material while reviewing slides or taking notes, which helps retain information better than reading alone.

Compliance Standards

Our API does not claim specific certifications like WCAG 2.1 or GDPR compliance for your final output. You are responsible for ensuring the audio file names, captions, and player controls meet your platform's accessibility requirements. The generated audio is a standard media asset that you control.

User Experience Benefits

Offering audio versions of your text lessons improves user experience by allowing on-the-go learning. Learners can engage with content during commutes or while multitasking, increasing course completion rates. The consistent voice quality across all lessons maintains a professional tone without requiring new actors for each module.

  • Supports 23 languages for global reach
  • Standard audio formats (MP3, WAV, OPUS)
  • No extra plugin required for LMS

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. These voices are best for core curriculum content where clarity and steady pacing are essential for retention.

Avatar of the voice aria
ariafemale
Avatar of the voice nova
novafemale
Avatar of the voice luna
lunafemale
Avatar of the voice sage
sagefemale
Avatar of the voice felix
felixmale
Avatar of the voice milo
milomale
Avatar of the voice atlas
atlasmale
Avatar of the voice orion
orionmale

23 languages

Any voice speaks any of these languages.

Sources and further reading

  1. Wikipedia
  2. openai-python on GitHub
  3. OpenAI API reference: create speech
  4. ISO 639 language codes
  5. curl documentation
  6. Tether (USDT)
  7. IETF RFC 7845: Ogg Opus
  8. Node.js documentation
  9. LibriVox public-domain audiobooks
  10. TRON developer hub: TRC-20
  11. LibriTTS-R paper (arXiv 2305.18802)
  12. openai-node on GitHub

More on this site