Audio Pitch & Speed
Adjust the pitch and playback speed of an audio file. The two are independent: changing speed does not affect pitch, and changing pitch does not affect duration. Powered by a high-quality algorithm that preserves timbre when shifting pitch, avoiding the "chipmunk" effect.
Create Task
Basic Information
| Item | Value |
|---|
| Request Method | POST |
| Request Path | /task/audio_stretch |
| Content-Type | application/json |
| Authentication | Raw API key in the Authorization header |
Request Body
| Parameter | Type | Required | Default | Description |
|---|
file_id | string | Yes | - | Uploaded audio file ID |
semitones | number | No | 0 | Pitch shift in semitones. Positive = up, negative = down, 0 = no change. Recommended range -12 to +12 |
speed | number | No | 1.0 | Speed multiplier. Greater than 1 = faster, less than 1 = slower, 1 = unchanged. Must be greater than 0, recommended range 0.5 to 2.0 |
Pitch and speed can be set together and do not interfere. For example, semitones=2 with speed=1.5 raises the pitch by two semitones while playing at 1.5x speed.
Request Example
curl -X POST https://api.ai-mcn.tv:10000/task/audio_stretch \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file_id": "537489015178246",
"semitones": 2,
"speed": 1.5
}'
Success Example
{
"code": 200,
"msg": "success",
"data": {
"task_id": "537489015178247",
"task_type": "audio_stretch",
"status": "queued"
}
}
Query Task Result
Basic Information
| Item | Value |
|---|
| Request Method | GET |
| Request Path | /task/audio_stretch/{task_id} |
| Authentication | Raw API key in the Authorization header |
Output Result (output_result)
| Parameter | Type | Description |
|---|
file_id | string | Generated audio file ID |
download_url | string | Download path for the generated file |
Success Example
{
"code": 200,
"msg": "success",
"data": {
"task_id": "537489015178247",
"status": "completed",
"progress": 100,
"output_result": {
"file_id": "537489015178248",
"download_url": "/download/a1/537489015178248.wav"
},
"create_time": "2026-05-30T08:00:00Z",
"update_time": "2026-05-30T08:00:20Z"
}
}
Limitations
- Input supports audio files only (
mp3, wav, m4a, aac, flac, ogg, etc.).
- Billed by audio duration (minutes).
- Output format is
wav.
speed must be greater than 0; the more extreme the semitones / speed values, the more noticeable the quality loss — stay within the recommended ranges.
Error Codes
| Error Code | HTTP Status | Description | Resolution |
|---|
6013 | 400 | Missing file_id | Pass the file_id field |
6014 | 400 | Unsupported file type, or semitones/speed is not a number | Upload a supported audio file and ensure params are numeric |
6016 | 400 | Invalid task parameters (e.g. speed ≤ 0) | Make speed greater than 0 |
6017 | 400 | Media probe failed | Ensure the file is a valid, non-corrupt audio |
6004 | 404 | File not found | Verify the file_id |
6502 | 401 | Authentication failed | Check the Authorization header |
6202 | 402 | Insufficient balance | Recharge in the Dashboard |