nomusic: remove music, keep the voice
Runs entirely on the user's machine. Nothing is uploaded. The video stream is copied without re-encoding. Reply in the user's language.
The user may have nothing installed except Claude Code. Do the setup yourself (Step 0), asking approval before installing system software. Never tell the user to go and set things up on their own unless an install fails.
Step 0: preflight and setup (always run first)
Detect the OS (uname -s or $env:OS / ver on Windows) and check each item. Install what is missing; tell the user in one line what you are installing and why before doing it.
| Need | Check | Install if missing |
|---|---|---|
| ffmpeg | ffmpeg -version | Windows: winget install Gyan.FFmpeg (then open a new shell or add it to PATH). macOS: brew install ffmpeg. Debian/Ubuntu: sudo apt install -y ffmpeg. Fedora: sudo dnf install -y ffmpeg |
| Python 3.9+ | python3 --version (or python --version / py -3 --version on Windows) | Windows: winget install Python.Python.3.12. macOS: brew install python. Linux: sudo apt install -y python3 python3-venv python3-pip |
| Private venv + packages | <venv>/bin/audio-separator --help (Scripts\audio-separator.exe on Windows) | python3 -m venv ~/.cache/nomusic/venv then <venv>/bin/python -m pip install "audio-separator[cpu]" audioread |
| Internet | PyPI + GitHub reachable | The ~67 MB model downloads from GitHub on first run |
Notes:
- Use a venv (above) so the user's system Python is untouched; no
--break-system-packagesneeded. - Package managers that need admin rights/sudo or a password: ask the user to approve or run that one command, then continue. If no package manager exists (e.g. no winget/brew), give the official download link and wait.
- If the network blocks PyPI/GitHub, say so plainly; do not try to bypass it.
- First run is slow (venv + model download, up to a few minutes). Later runs only take about 2x the clip length on CPU.
Method order (cheapest first)
- Local, free (default):
audio-separatorwithUVR-MDX-NET-Voc_FT. - ffmpeg filtering: only if (1) fails. Lower quality, cannot guarantee full music removal.
- Paid/external stem separation: last resort; uploads the user's file to a third party, so get explicit permission first.
If the user wants all audio removed (no voice to keep): ffmpeg -i in.mp4 -c:v copy -an out.mp4.
Steps
- Inspect:
ffprobe -show_entries stream=codec_type,codec_name,channels,duration in.mp4. - Commands:
- Extract:
ffmpeg -i in.mp4 -vn -c:a libmp3lame -q:a 2 audio.mp3 - Separate:
audio-separator audio.mp3 --model_filename UVR-MDX-NET-Voc_FT.onnx --output_dir sep --model_file_dir <models-dir>→*Vocals*.flacand*Instrumental*.flac - Remux:
ffmpeg -i in.mp4 -i sep/<vocals>.flac -map 0:v -map 1:a -c:v copy -c:a aac -b:a 192k -shortest out.mp4
- Extract:
- Verify: spectrogram (
ffmpeg -i vocals.flac -lavfi showspectrumpic=s=1000x300:legend=0 spec.png). Speech should look like separate phrases with silence between. Compare RMS with the original. - Deliver the file; say you cannot listen to it, so the user should check by ear.
Gotchas
ModuleNotFoundError: audioreadmeans it was not installed alongsideaudio-separator; install both.- demucs often fails in restricted networks (its weights are on a blocked host, HTTP 403). Do not bypass;
audio-separatormodels come from GitHub. - Mono audio (L == R): mid/side "center channel" tricks do nothing; use the model.
- Audio may be shorter than the video;
-shortesttrims to the audio, or leave the tail silent. - If music residue remains, try another free UVR model before suggesting anything paid.
- Only tested on Linux; Windows/macOS commands above are standard but unverified.