剪映 icon

剪映

使用剪映 API 进行视频编辑操作

Draft → Add Audio

AI-generated

Summary

Add an audio track to an existing video draft by specifying parameters such as the draft ID, audio URL, canvas dimensions, playback timing, volume, speed, track name, duration, and optional audio effects.

Inputs

  • draftId (required) — The identifier of the draft to which the audio will be added.
  • audioUrl (required) — The URL address of the audio file to add.
  • canvasWidth — Width of the canvas for positioning the audio (default is 1080).
  • canvasHeight — Height of the canvas for positioning the audio (default is 1920).
  • start — Start time in seconds to trim the source audio (default is 0).
  • end — End time in seconds to trim the source audio; 0 means until the audio's end (default is 0).
  • volume — Audio volume level from 0 to 1 (default is 1).
  • speed — Playback speed multiplier (>1 speeds up, <1 slows down; default is 1).
  • targetStart — Start position in seconds on the draft's timeline where the audio will be placed (default is 0).
  • trackName — Name of the track to distinguish different audio tracks.
  • duration — Total duration in seconds of the audio asset to improve request speed (optional).
  • effectType — Type of audio effect to apply (e.g., echo, reverb).
  • effectParams — Parameters for the audio effect, specified as comma-separated values.
  • jsonParameters — All parameters can alternatively be passed directly as a JSON object, which will override individual fields.

Output shape

a JSON object representing the updated draft after adding the audio track

Optional JSON input can override individual parameters. Audio effect parameters are parsed as integer arrays. The response is returned as JSON and includes metadata for workflow processing. Errors are reported per item if 'continueOnFail' is enabled.

Discussion