Add or mix video audio
video_add_audioAdd, replace, or mix an audio track into an existing video to score or re-voice it, then render a new output file while keeping the source media unchanged.
Instructions
Add, replace, or mix an audio track into an existing video and render a new output file. Returns JSON {success, output_path}. Use to score or re-voice a video; source video and audio are read only. Pass video_path as the source video and audio_path as the audio file; set mix to combine or false to replace.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mix | No | True mixes the new audio with existing video audio; false replaces the original audio track. | |
| volume | No | Audio gain from 0.0 to 2.0, where 1.0 preserves original loudness. | |
| fade_in | No | Non-negative fade-in duration in seconds applied to the inserted audio. | |
| fade_out | No | Non-negative fade-out duration in seconds applied near the inserted audio end. | |
| overwrite | No | Explicitly allow replacing existing media. Existing non-media files are protected. | |
| audio_path | Yes | Absolute path to an existing local audio file such as MP3, WAV, M4A, or AAC. | |
| start_time | No | Optional start offset in seconds where the inserted audio begins. | |
| video_path | Yes | Absolute path to an existing local video file. The input file is read only. | |
| output_path | No | Destination video path. Auto-generated when omitted; an existing supplied path may be overwritten. | |
| duration_policy | No | How to reconcile audio and video length: keep_video (default, preserves the full video/outro), pad_audio, loop_audio, trim_audio, or shortest (may trim the outro). | keep_video |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||