Add a music track or sound effect that plays as a project-level audio layer over all clips. Does NOT consume a clip slot. Use this for background music or a soundtrack that should play under the existing timeline. (For inserting an audio file as its own sequential clip with auto-transcription, use add_clips(kind='video') with an audio mime_type instead.)
- type="music": requires src, name, source_duration. `src` is either the `src` from a find(type='music') result, or an mcp_upload_id (prefixed `mup_`) from upload_file — upload ids resolve to a presigned URL server-side. For a Freesound result the `src` is an opaque handle; pass it through unchanged and Clueso downloads + hosts the original server-side (do not try to fetch it yourself). Get `source_duration` from the find result, or from analyze_audio mode='features' (data.duration_ms / 1000). Optional: guide_start_time, guide_end_time, music_start_time, music_end_time (trim the source track), volume, loop, fade_in, fade_out.
- type="sfx": pass the `src`, `name`, and `source_duration` from a find(type='sfx') result, plus guide_start_time (Freesound `src` is an opaque handle, resolved server-side just like music). Optional: volume. (Legacy: a fixed-library `sfx_key` like 'whoosh' still works instead of src.)
Concurrency: whole-project mutation (conflict domain: the entire project) — serialize; do not run in parallel with ANY other mutation on the same project_id (including element/voiceover edits). Size your clips BEFORE calling add_audio, or pass guide_end_time explicitly — the default ('end of project') is captured at call time and will NOT auto-extend if clips are added or resized afterwards.
Connector