AnyTool
Your files never leave your device. All processing happens locally in your browser.

How do I add or replace the audio on a video in my browser?

Open AnyTool's Add Audio to Video, drop in a video and an audio file, and choose a mode: Replace swaps the soundtrack (the video is stream-copied, so it is fast and lossless), or Mix overlays your new music over the original audio with independent volume control. You can loop short audio or trim long audio to match the video length. It runs with a self-hosted ffmpeg engine right in your browser — the files are never uploaded, the engine is bundled (no CDN), and there is no watermark or size cap.

  • Replace (swap the track, video stream-copied — fast & lossless) or Mix (overlay)
  • Independent volume control; loop short or trim long audio to fit
  • Inputs: video + MP3/WAV/AAC/M4A/OGG/FLAC audio → MP4
  • Self-hosted engine — no CDN, no upload, no watermark

What is

Adding audio to video

Adding audio to a video either replaces its existing soundtrack with an uploaded audio file or mixes the new audio over the original. Replace mode can stream-copy the video (no re-encode, fast and lossless), while mix mode blends both tracks with independent volumes; the added audio can be looped if short or trimmed if longer than the video. Client-side processing runs in the browser, so nothing is uploaded.

Video Tools

Related terms

replace audiobackground musicaudio mixsoundtrackffmpeg

How to Add Audio to a Video

Add or replace a video's audio in your browser.

30 secWeb browser
  1. 1

    Add files

    Drop in a video and an audio file — they stay on your device.

  2. 2

    Choose a mode

    Pick Replace or Mix, set the volume, and loop or trim the audio to fit.

  3. 3

    Export

    Render and download an MP4 — nothing is uploaded.

Result: A video with new audio

Frequently Asked Questions

Both — Replace swaps the audio track, while Mix overlays your new audio over the original.

Mix gives each track independent volume so you can balance music against the original sound.

You can loop short audio to fill the clip, or trim long audio to match the video length.

The output is trimmed to the video's duration so the result lines up cleanly.

No upload — it runs in your browser, and it accepts MP3, WAV, AAC, M4A, OGG and FLAC.

In Replace mode the video is stream-copied so it stays lossless and fast; the output is an MP4.

Detailed Explanation

Methodology

How Add Audio to Video Works

AnyTool adds audio to a video entirely in the browser using a self-hosted single-threaded ffmpeg.wasm engine — the core (ffmpeg-core.js + the 32 MB wasm) is bundled from npm and served as a same-origin asset, so nothing is fetched from a CDN. Both files are written to ffmpeg's virtual filesystem (MEMFS) and combined in one of two modes. Replace maps the new audio with the original video stream copied through (-c:v copy), which is fast and lossless, and uses -shortest to end at the shorter input. Mix blends the original and new tracks with the amix filter using independent per-track volume controls. In either mode, a short audio file can be looped to the video length with -stream_loop. The combined result is read back as an MP4 blob. Single-threaded is deliberate: the multi-threaded core needs SharedArrayBuffer + cross-origin isolation (COOP/COEP), which would block cross-origin ad iframes.

  • Runs client-side — the files are never uploaded
  • Self-hosted ffmpeg core (bundled) — no CDN
  • Replace: new audio + video stream-copied (-c:v copy), -shortest
  • Mix: amix with independent per-track volume
  • Short audio looped to length with -stream_loop
  • MP4 output; no backend, no watermark, no size cap
Privacy & Security

Privacy vs Upload-based Mergers

Most online tools that add music to a video upload both files and cap the size or add a watermark. AnyTool combines them locally with a bundled engine — in Replace mode the video is stream-copied so it stays lossless — so nothing leaves your browser, there is no size cap or watermark and no signup, and it works offline after the first load.

Add audio to video: AnyTool vs typical tools
CapabilityAnyToolTypical tools
Data handlingIn your browserOften uploaded
Replace modeVideo stream-copied (lossless)Re-encoded
Mix modeamix + per-track volumeVaries
Loop short audioYes (-stream_loop)Rare
CostFree, no signupFree/limited

AnyTool is a privacy-first client-side audio merger — combining runs locally and nothing is uploaded.