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:
- Create Task: Submit your audio sample and text for processing
- Monitor Progress: Check the status of your task periodically
- Download Result: Retrieve the generated audio when complete
API Endpoints
Endpoint | Purpose | Description |
---|---|---|
Create Task | Submit processing request | Upload audio and text to start voice cloning |
Task Status | Monitor progress | Check current status and estimated completion |
Task Result | Download audio | Retrieve the generated voice clone |
When to Use Async API
Recommended for:
- 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:
- Prepare your content: Ensure your text is over 500 characters
- Upload audio sample: Provide a 5-30 second voice sample
- Submit task: Use the Create Task endpoint
- Monitor progress: Poll the Task Status endpoint
- 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:
- Create Task - Submit voice cloning task
- Task Status - Monitor task progress
- 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
Parameter | Type | Required | Description |
---|---|---|---|
audio | File (binary) | Yes* | Audio file for voice cloning. Supported formats include WAV, MP3, and M4A. You must provide either audio or audio_url . |
audio_url | string | Yes* | Publicly accessible audio file URL (WAV, MP3, M4A). You must provide either audio or audio_url . |
text | string | Yes | The text you want to synthesize with the cloned voice. |
api_key | string | Yes | Your unique API key for authentication and access. This key is used to verify your request and link it to your user account. |
voice_id | string | No | Optional 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 neitheraudio
noraudio_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
Status | Description |
---|---|
pending | Task submitted, waiting for processing |
processing | Task is being processed |
completed | Task completed |
failed | Task 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