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

ItemValue
Request MethodPOST
Request Path/task/audio_stretch
Content-Typeapplication/json
AuthenticationRaw API key in the Authorization header

Request Body

ParameterTypeRequiredDefaultDescription
file_idstringYes-Uploaded audio file ID
semitonesnumberNo0Pitch shift in semitones. Positive = up, negative = down, 0 = no change. Recommended range -12 to +12
speednumberNo1.0Speed 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

ItemValue
Request MethodGET
Request Path/task/audio_stretch/{task_id}
AuthenticationRaw API key in the Authorization header

Output Result (output_result)

ParameterTypeDescription
file_idstringGenerated audio file ID
download_urlstringDownload 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 CodeHTTP StatusDescriptionResolution
6013400Missing file_idPass the file_id field
6014400Unsupported file type, or semitones/speed is not a numberUpload a supported audio file and ensure params are numeric
6016400Invalid task parameters (e.g. speed ≤ 0)Make speed greater than 0
6017400Media probe failedEnsure the file is a valid, non-corrupt audio
6004404File not foundVerify the file_id
6502401Authentication failedCheck the Authorization header
6202402Insufficient balanceRecharge in the Dashboard