Skip to Content

Asynchronous Voice Cloning

The asynchronous voice cloning API is designed for processing longer text content that requires more time to generate. This approach is ideal for:

  • Long-form content: Articles, books, or extensive documentation
  • Large-scale processing: Multiple audio files or batch operations
  • Background processing: Tasks that can run while users continue other activities

How It Works

The asynchronous API follows a three-step process:

  1. Create Task: Submit your audio sample and text for processing
  2. Monitor Progress: Check the status of your task periodically
  3. Download Result: Retrieve the generated audio when complete

API Endpoints

EndpointPurposeDescription
Create TaskSubmit processing requestUpload audio and text to start voice cloning
Task StatusMonitor progressCheck current status and estimated completion
Task ResultDownload audioRetrieve the generated voice clone

When to Use Async API

  • Text longer than 500 characters
  • High-quality audio generation
  • Batch processing multiple texts
  • Applications that can handle delayed results

Processing Times:

  • Short texts (500-5000 chars): 2-5 minutes
  • Medium texts (5000-15000 chars): 5-10 minutes
  • Long texts (15000+ chars): 10-20 minutes

Getting Started

To begin using the asynchronous API:

  1. Prepare your content: Ensure your text is over 500 characters
  2. Upload audio sample: Provide a 5-30 second voice sample
  3. Submit task: Use the Create Task endpoint
  4. Monitor progress: Poll the Task Status endpoint
  5. Download result: Retrieve your audio via Task Result

For shorter texts, consider using the Synchronous API for immediate results.

Asynchronous Processing Workflow Overview

Asynchronous voice cloning includes the following three steps:

  1. Create Task - Submit voice cloning task
  2. Task Status - Monitor task progress
  3. Task Result - Download generated audio

Use Cases

  • Text length greater than 500 characters
  • Need to process multiple voice cloning tasks
  • Scenarios where response time is not critical

Basic Workflow

Usage Recommendations

  • Text Length: Suitable for processing long texts greater than 500 characters
  • Polling Interval: Recommended to query task status every 30 seconds
  • Timeout Handling: Contact technical support if task doesn’t complete within 10 minutes
  • Result Download: Download audio files promptly after task completion

Error Handling

Common async task errors:

  • Unsupported audio file format
  • Text content contains unsupported characters
  • Invalid or expired API key
  • Insufficient server processing capacity

Create Voice Cloning Task

Start a voice cloning task. You can upload audio files directly or provide URLs to existing audio files.

Request Information

  • Method: POST
  • Endpoint: /api/instant/create-task
  • Content Type: multipart/form-data

Request Parameters

ParameterTypeRequiredDescription
audioFile (binary)Yes*Audio file for voice cloning. Supported formats include WAV, MP3, and M4A. You must provide either audio or audio_url.
audio_urlstringYes*Publicly accessible audio file URL (WAV, MP3, M4A). You must provide either audio or audio_url.
textstringYesThe text you want to synthesize with the cloned voice.
api_keystringYesYour unique API key for authentication and access. This key is used to verify your request and link it to your user account.
voice_idstringNoOptional voice ID parameter

*Note: Either audio or audio_url parameter is required, at least one must be provided.

Response

Success Response

{ "task_id": "1406bf34-735c-4b21-98ac-a135b2afb1c8", "status": "pending" }

Error Response

  • 400 Bad Request: Missing required parameters (e.g., api_key, or neither audio nor audio_url provided)

Example Requests

Using Audio File

curl -X POST https://aivoiceclonefree.com/api/instant/create-task \ -F "[email protected]" \ -F "text=This is a long text suitable for async interface processing..." \ -F "api_key=your_api_key_here"

Using Audio URL

curl -X POST https://aivoiceclonefree.com/api/instant/create-task \ -F "audio_url=https://example.com/sample.mp3" \ -F "text=This is a long text suitable for async interface processing..." \ -F "api_key=your_api_key_here"

Task Status Description

StatusDescription
pendingTask submitted, waiting for processing
processingTask is being processed
completedTask completed
failedTask processing failed

Usage Recommendations

  • Suitable for processing long texts greater than 500 characters
  • Recommended to query task status every 30 seconds
  • Download audio files promptly after task completion
Last updated on