How to Generate Cartoon Dialogue with TTS API?

By ToonSonic editorial team · Updated 2026-11-18

This guide explains how to generate cartoon dialogue using the ToonSonic TTS API. You will learn to structure POST requests to https://api.u777play.com/v1, select from eight voice presets derived from licensed LibriTTS-R recordings, and configure audio formats optimized for animation timing. The process covers handling 23 languages, managing speed settings, and integrating the API into your existing production pipeline with minimal code.

Designed for animation creators, this page provides concrete steps for batch processing scripts, estimating costs based on character counts, and ensuring consistent voice quality across episodes. You will find ready-to-use examples in Python, JavaScript, and cURL, along with details on licensing, error handling, and support resources to streamline your dialogue workflow.

How to Generate Cartoon Dialogue with TTS API?

Frequently asked questions

What is the best voice for a cartoon character?

Select from eight presets matching your character’s tone. Options include Aria (warm narrator), Nova (bright), Luna (soft storytelling), Felix (energetic promo), Milo (friendly), Atlas (neutral news), Orion (deep documentary), and Sage (calm). All voices support any of the 23 available languages.

How do I change the speed of the TTS audio?

Include the speed parameter in your JSON request body. Acceptable values range from 0.25 to 4.0. The default speed is 1.0. This allows you to adjust the pacing of dialogue or narration directly within the API call without post-processing.

Can I use the API for voiceovers in multiple languages?

Yes. The API supports 23 languages including English, Japanese, Spanish, and Hindi. Any voice can speak any supported language. You can optionally specify the ISO language code to ensure correct pronunciation, though the system guesses the language from the script if omitted.

How do I handle long scripts in the API?

The API accepts up to 4096 characters per request. For longer scripts, split the text into chunks of 4096 characters or less. Generate audio for each chunk and join the resulting audio files to create the final dialogue track.

Is the API suitable for real-time animation?

It is not designed for real-time streaming. Requests are processed sequentially, so under load, a request may wait in a queue. Generation takes roughly real-time duration (25 characters per second). It is best for pre-rendered animation pipelines rather than live sync.

What is the difference between tts-1 and tts-1-hd?

Both models use the same engine and have the same price. The only difference is the model identifier string you send in the request. They produce audio of identical quality and cost $10 per 1 million characters.

Can I use the generated audio for commercial projects?

Yes. The API provides a straightforward service for generating audio files. Generated audio is returned in the response and not stored. Input text is not used for training. You receive the file to use in your animation projects immediately.

How do I set the language for non-English text?

Include the language field in your JSON request body with the ISO code (e.g., "de" for German). If omitted, the system guesses the language. For non-English Latin-script text, explicitly setting the language ensures accurate pronunciation and avoids defaulting to English.

What audio formats are supported?

You can request audio in mp3, wav, opus, flac, or pcm formats. Specify the desired format using the response_format field in your request body. This allows you to choose the best balance of quality and file size for your animation pipeline.

How do I integrate the API with my animation software?

Use standard HTTP POST requests to https://api.u777play.com/v1/audio/speech. Send your text and parameters in the JSON body. Authenticate with your Bearer token. Receive the audio file in the response. You can also use OpenAI SDKs by changing the base_url.

Are there any rate limits for free accounts?

Yes. The rate limit is 60 requests per minute per key. Before your first top-up, the limit is 10 requests per minute. Failed requests are free and do not reduce your balance or character count.

Can I clone my own voice for a character?

No. The API uses eight fixed voice presets. There is no custom voice cloning feature, no uploading of your own voice samples, and no voice design tools. You must use one of the provided voices like Aria, Nova, or Felix.

How do I check my API usage?

Log in to your account on the /get-api-key/ page. The dashboard displays your current balance, trial status, characters remaining, and usage history. You can also view your active API key and generate a new one if needed.

What happens if I exceed the character limit?

Each request accepts up to 4096 characters. If you exceed this limit, the API may reject the request. For longer scripts, split your text into parts of up to 4096 characters and join the resulting audio files. This ensures consistent delivery without truncation or implementation-specific behavior.

Understanding the API Endpoint

Sound wave illustration for: Understanding the API Endpoint

To generate cartoon dialogue, send a POST request to https://api.u777play.com/v1/audio/speech. The API accepts JSON bodies containing the script text and voice configuration, returning an audio file directly in the response stream.

POST Request Structure

Use the standard OpenAI-compatible endpoint shape. Send your API key via the Authorization: Bearer header. The request body must include the model (e.g., tts-1), the input text, and the voice preset.

  • Endpoint: POST https://api.u777play.com/v1/audio/speech
  • Auth: Authorization: Bearer tts-...
  • Rate limit: 60 requests/minute per key

JSON Body Format

Structure your request with model, input (max 4096 characters), voice, and optional speed (0.25–4.0) or response_format. The input field holds your character dialogue. Ensure all fields are valid strings to avoid silent failures.

Audio Response Handling

The API returns the audio file directly in the response body. If synthesis fails, the request is free, and you receive no charge. Requests are processed sequentially, so under heavy load, synthesis may queue, affecting real-time generation timing.

Selecting the Right Voice

Sound wave illustration for: Selecting the Right Voice

Each voice preset has a distinct tonal character derived from licensed recordings, allowing you to match specific character archetypes without manual voice direction. You can assign different voices to different characters within a dialogue scene to create clear audio distinction.

All eight voices support all 23 languages. If the language field is omitted, the API guesses the language from the script, defaulting to English for Latin text. For non-English Latin scripts, explicitly set the language ISO code to ensure accurate pronunciation.

Female Voices: Aria, Nova, Luna, Sage

Aria provides a warm, clear narration suitable for primary protagonists. Nova offers a bright, upbeat tone ideal for energetic or comedic characters. Luna is soft and storytelling-oriented, while Sage delivers a calm, instructional voice for explanatory dialogue.

These presets do not support dynamic emotion tags or SSML. The tonal quality is fixed per voice, ensuring consistency across episodes but requiring careful selection to match character personality.

  • Aria: warm, clear narrator
  • Nova: bright, upbeat
  • Luna: soft, storytelling
  • Sage: calm, instructional

Male Voices: Felix, Milo, Atlas, Orion

Felix is energetic and promo-ready, good for sales pitches or high-energy scenes. Milo is friendly and conversational, ideal for casual interactions. Atlas provides a neutral, news-like delivery for straightforward dialogue. Orion offers a deep, documentary-style tone for serious or authoritative characters.

Like the female voices, these presets have fixed characteristics. Use Atlas for neutral narration or Orion for deep, gravitas-heavy roles.

  • Felix: energetic, promo
  • Milo: friendly, conversational
  • Atlas: neutral, news
  • Orion: deep, documentary

Matching Tone to Character

Assign voices based on consistent archetypes across your series. For example, use Nova for a quirky sidekick and Atlas for a serious antagonist. Ensure the voice’s inherent tone aligns with the character’s visual design and script intent.

Since there is no voice cloning, you cannot create unique voices for minor characters. Reuse the eight presets across different characters, relying on pitch variation (via speed) and context to distinguish them.

Selecting the Right Voice

Configuring Speed and Format

Sound wave illustration for: Configuring Speed and Format

Control vocal pacing with the speed parameter (0.25–4.0) to match character emotions or action sequences. Lower speeds suit dramatic pauses, while higher values accelerate comedic delivery. Speed adjustments affect generation time proportionally, so test extremes early in your pipeline to ensure they fit your animation frames.

Choose mp3 for efficient storage and web playback, or wav for lossless quality during editing. The API returns audio directly in the response, allowing immediate integration into your timeline without intermediate file management steps.

Adjusting Speed from 0.25 to 4.0

Set the speed value to control pacing. Values below 1.0 slow delivery for serious or emotional lines, while values above 1.0 increase energy for fast-paced scenes. Note that extreme speeds may slightly alter perceived naturalness, so verify with sample outputs.

Speed changes also impact generation time. Higher speeds process text faster, but queue times remain consistent based on server load. Test 0.5x and 2.0x speeds to find the sweet spot for your specific character voices.

  • 0.25: Slow, deliberate, emotional
  • 1.0: Natural, standard pacing
  • 2.0: Energetic, upbeat
  • 4.0: Fast, compressed delivery

Choosing MP3 or WAV Output

Select mp3 for small file sizes and easy web streaming. Use wav if your editing software requires uncompressed audio for precise trimming. Both formats preserve the voice quality generated by the model.

Other formats like opus and flac are available for specific workflow needs. mp3 is generally recommended for dialogue due to its balance of quality and size.

Optimizing for Animation Timing

Generate audio before finalizing lip-sync to ensure dialogue fits visual constraints. Use the character count to estimate duration, keeping in mind that speed adjustments change timing significantly.

Avoid relying on real-time generation for final renders. Pre-generate all dialogue assets and store them locally. This ensures consistency and prevents queue delays during production spikes.

Handling Multiple Languages

Sound wave illustration for: Handling Multiple Languages

ToonSonic supports 23 languages, allowing you to localize dialogue without selecting different voices. Each voice can naturally speak any supported language, from Arabic to Turkish, ensuring consistent character identity across your series.

Setting Language ISO Codes

For non-English Latin-script text, always set the language parameter. This prevents the API from defaulting to English pronunciation. Supported codes include ar, zh, da, nl, en, fi, fr, de, el, he, hi, it, ja, ko, ms, no, pl, pt, ru, es, sw, sv, and tr.

Auto-Detection Logic

If you omit the language field, the system guesses the language based on the script. Latin characters default to English. This works for simple English dialogue but may cause errors for other languages using Latin script.

Handling Non-Latin Scripts

Non-Latin scripts like Chinese, Japanese, Arabic, or Hebrew are detected automatically. You do not need to specify the language code for these. However, ensure your input text matches the target language to avoid mispronunciation.

  • Not supported: Vietnamese, Indonesian, Thai, Ukrainian, Romanian, Czech, Bengali.

Batch Processing for Episodes

Sound wave illustration for: Batch Processing for Episodes

For animation episodes exceeding 4096 characters, split the script into chunks and send parallel POST requests to generate audio segments. This ensures consistent voice delivery across long dialogues without truncation limits.

Splitting Long Scripts

Divide your script into segments of up to 4096 characters. Each segment triggers a separate synthesis request, allowing the API to process them independently while maintaining voice consistency.

  • Split text at natural pause points to avoid audio glitches.
  • Ensure each chunk stays within the 4096-character limit.
  • Track segment IDs to maintain correct ordering later.

Joining Audio Files

The API returns individual audio files for each request. Use a library to join these files into a single continuous track, ensuring seamless playback for your animation timeline.

  • Use FFmpeg or similar tools for reliable concatenation.
  • Verify format compatibility (e.g., MP3 to MP3).
  • Check for gaps between joined segments.

Automating Workflow

Integrate splitting and joining logic into your pipeline. Automate the sequence of requests and post-processing to streamline the production of full episode audio assets efficiently.

  • Script the split-join process for repeatable results.
  • Monitor rate limits (60 req/min) during batch jobs.
  • Log character counts for accurate billing estimates.

Cost Estimation for Dialogue

Sound wave illustration for: Cost Estimation for Dialogue

Generating cartoon dialogue requires precise character counting since costs are calculated per character, including spaces and punctuation. The rate is $0.01 per 1,000 characters, or $0.00001 per character. A typical 2-minute scene contains roughly 3,000 characters, costing approximately $0.03. Failed requests incur no charge, protecting your budget during testing.

For series production, multiply your script’s total character count by $0.00001 to estimate expenses. Since voices can speak any of the 23 supported languages without extra fees, you can localize dialogue without changing the cost structure. This linear pricing model makes budgeting straightforward for episodic content.

Character Count Calculation

Count every character in your script, including spaces and punctuation. The API charges $0.01 per 1,000 characters. A 2-minute scene typically contains about 3,000 characters, costing $0.03. Longer texts are split into 4,096-character chunks, but the total cost remains based on the full character count.

Failed synthesis requests are free, so you can test voice outputs without financial risk. This allows you to refine dialogue timing before committing to full episode production.

  • Count spaces and punctuation as characters
  • Cost: $0.00001 per character
  • Failed requests are free

Budgeting for Series

Calculate total series costs by summing all script characters and multiplying by $0.00001. Since all voices share the same engine and price, you can mix characters without varying costs. No monthly plans or minimum spends apply, so you only pay for what you generate.

Balance does not expire, allowing you to accumulate credits over time. This flexibility suits production schedules where audio generation may be sporadic or batched.

  • No monthly plans
  • Balance does not expire
  • Mix voices at same price

Free Trial Usage

New accounts signing in with Google receive $0.50 in trial credit, valid for 7 days. This covers approximately 50,000 characters, enough for about 16 hours of dialogue. Accounts created with email and password start without trial credit.

Use the trial to test voice consistency and format options before purchasing USDT via the TRON network for top-ups. Minimum top-up is $5, credited automatically within minutes.

  • $0.50 trial for Google sign-ins
  • Valid for 7 days
  • ~50,000 characters included

Error Handling in Production

Sound wave illustration for: Error Handling in Production

When synthesis fails, the API returns the full charge, so retrying failed requests incurs no additional cost. This allows you to implement simple exponential backoff without worrying about budget spikes during unstable network conditions or temporary server queues.

Since the system processes requests sequentially, under load your request may wait in a queue. Failed requests are automatically refunded, ensuring reliability without financial penalty for transient errors.

Retrying Failed Requests

Implement retry logic for failed synthesis requests. Since charges are reversed on failure, you can retry aggressively to ensure the audio file is generated successfully. This is particularly useful when handling dialogue lines that must be ready before animation frames are finalized.

  • Retry on HTTP errors or synthesis failures.
  • No extra cost if the retry succeeds or fails again.

Monitoring Rate Limits

You are limited to 60 requests per minute per key (10 per minute before the first top-up). Plan your batch processing to stay within these limits. If you exceed the limit, subsequent requests will be rejected until the window resets.

Track your request volume manually or via your own logging, as specific HTTP headers for rate limits are not exposed. Adjust your submission frequency to avoid bottlenecks during peak production hours.

  • Limit: 60 requests/minute per key.
  • No exposed headers; monitor via your own logs.

Logging Usage Data

Request metadata, including time, character count, and status, is retained for billing purposes. Use this data to audit your usage and estimate costs for upcoming episodes. Log the status of each request to identify patterns in failure or delay.

Since audio files are not stored after the response, ensure you save the generated audio locally. Logging the request ID and timestamp helps you correlate specific audio files with their source scripts for version control.

  • Metadata kept for billing.
  • Log request ID, timestamp, and status.
Error Handling in Production

Licensing and Usage Rights

Sound wave illustration for: Licensing and Usage Rights

The voices powering ToonSonic are derived from licensed recordings under CC BY 4.0, sourced from LibriTTS-R and public-domain LibriVox audiobooks. This foundation allows for consistent, licensable voice assets without the overhead of manual recording sessions for every line of dialogue.

CC BY 4.0 Source Material

Each voice preset is built from licensed recordings that carry the Creative Commons Attribution 4.0 license. This legal framework ensures that the underlying voice models are cleared for commercial animation projects, removing ambiguity about voice ownership for your studio.

  • Built on LibriTTS-R (CC BY 4.0)

Commercial Use Permissions

You may use the generated audio files directly in your cartoons, promos, and episodes for commercial purposes. The API returns the audio file in the response without storing it on our servers, so your script and audio assets remain yours. No additional attribution is required beyond standard licensing norms, though it is appreciated.

  • Use in commercial animations and promos

Watermark Information

Every generated audio file includes an inaudible watermark that identifies the speech as synthetic. This watermark does not affect audio quality or playback in animation software. It serves as a clear marker of AI-generated content, which is useful for transparency in production pipelines.

Integration Examples

Sound wave illustration for: Integration Examples

Integrate ToonSonic’s TTS API into your animation pipeline using standard HTTP requests or the OpenAI SDK. Configure the base URL to point to our endpoint and use your API key for authentication. This approach allows seamless embedding of generated voice lines directly into your project files.

Python Script Example

Install the openai package and configure the client with base_url="https://api.u777play.com/v1". Pass your text, voice selection, and desired format to the audio.speech method. The response returns the audio file directly, which you can save to disk for use in your animation software.

  • Configure base_url to our API domain
  • Use standard OpenAI SDK methods
  • Receive audio file directly in response

JavaScript Fetch Example

Use the native fetch API to send a POST request to the speech endpoint. Include your API key in the Authorization header. Send the text payload as JSON and handle the binary response to save the audio file locally or stream it for playback.

  • Use native fetch for lightweight integration
  • Set Authorization header with Bearer token
  • Handle binary audio response efficiently

cURL Command Example

Execute a simple cURL command to generate audio directly from the terminal. Specify the model, voice, and input text in the JSON body. This method is ideal for quick tests or scripting batch generation tasks within your animation workflow without writing full application code.

  • Quick testing and validation
  • Scriptable for batch operations
  • No additional dependencies required

Common Pitfalls

Sound wave illustration for: Common Pitfalls

Developers often assume the API handles text segmentation automatically, leading to unexpected failures when scripts exceed the 4096-character limit per request. The service does not truncate long inputs; it rejects the payload entirely if the input field contains more than 4096 characters. You must split your dialogue into chunks and join the resulting audio files manually or via a script.

Ignoring Language Tags

Latin-script text defaults to English if the language field is omitted. This causes errors when generating dialogue in other supported languages like German, French, or Dutch using Latin characters. Always explicitly set the language parameter to the correct ISO code to ensure the correct voice model is applied.

  • Set language for all non-English Latin text.
  • Default fallback is English.
  • Supported scripts include Latin, Cyrillic, Arabic, and CJK.

Exceeding Character Limits

The API rejects requests where the input field exceeds 4096 characters. It does not truncate the text. You must implement client-side logic to split long scripts into valid chunks before sending them to the endpoint.

  • Limit: 4096 characters per request.
  • Payload rejected if exceeded.
  • Split text and join audio files.

Misinterpreting Speed Values

The speed parameter accepts values between 0.25 and 4.0. A value of 1.0 is normal pace. Values below 1.0 slow down the speech, while values above 1.0 speed it up. Ensure your animation timing aligns with the adjusted duration, as the generation time remains roughly real-time per character regardless of speed.

  • Range: 0.25 to 4.0.
  • 1.0 is normal speed.
  • Generation time is roughly real-time.

Best Practices for Animators

Sound wave illustration for: Best Practices for Animators

Consistent voice delivery is critical for character believability. Generate audio in batches using the same voice and speed parameters to maintain tonal uniformity across scenes. Test short phrases early to identify pacing issues before committing to full episode scripts.

Use the 0.25–4.0 speed range to fine-tune delivery. If a line feels rushed, reduce speed incrementally rather than rewriting text. Keep a log of preferred settings per character to ensure consistency across episodes.

Pre-Generating Audio Assets

Generate audio files while animating to save time. Use the API to create dialogue in advance, allowing animators to lip-sync to actual recordings. This workflow reduces revision cycles since the timing is fixed.

  • Batch requests for efficiency
  • Store generated MP3s in asset folders

Version Control for Scripts

Track script changes alongside audio outputs. Since input text determines the output, store the exact text used for each audio file in your repository. This ensures reproducibility if assets need regeneration.

Testing Voice Consistency

Compare outputs from the same voice across different requests. Ensure language codes are set explicitly for non-English lines to prevent auto-detection errors. Verify that speed adjustments do not alter the voice’s core tone.

  • Use identical voice IDs
  • Log speed settings
Best Practices for Animators

Support and Resources

Sound wave illustration for: Support and Resources

Support is handled exclusively via email; there is no phone number or live chat. For detailed technical references, including endpoint specifications and voice lists, visit the official API documentation. This resource covers all request parameters, authentication methods, and error codes required for integrating the TTS engine into your animation pipeline.

There are no official community forums managed by ToonSonic. For broader discussions on animation production workflows, you may consult general industry forums, but specific API troubleshooting should be directed through the support email or the documentation page.

API Documentation Link

The complete API reference is available at https://u777play.com/docs/. It details the /v1/audio/speech endpoint, voice presets, and format options like MP3 and WAV. Use this guide to verify request structures and understand rate limits (60 requests per minute).

The docs also explain the character limit of 4,096 per request and how to handle longer scripts by splitting and joining audio files. Review the error codes section to troubleshoot common synthesis failures.

  • Endpoint: POST /v1/audio/speech
  • Base URL: https://api.u777play.com/v1
  • Formats: MP3, WAV, OPUS, FLAC, PCM

Community Forums

ToonSonic does not maintain official community forums. Users seeking peer discussion should look to general animation or developer communities. For precise answers regarding API behavior, refer to the documentation or contact support directly.

Email Support Contact

All support inquiries are handled via email only. There is no live chat or phone support. Please include your API key and a description of the issue when emailing support to ensure a prompt response.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Bring your characters to life by mastering the subtle art of expressive timing and fluid motion in your animated scenes.

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. curl documentation
  3. FFmpeg documentation
  4. openai-python on GitHub
  5. LibriTTS-R corpus (OpenSLR 141)
  6. MDN: Web Speech API
  7. W3C WAI: making audio and video accessible
  8. ISO 639 language codes
  9. LibriTTS-R paper (arXiv 2305.18802)
  10. IETF RFC 7845: Ogg Opus
  11. Tether (USDT)
  12. Python documentation

More on this site