Convert Audio Mono
Documentsconvert-audio-monoConvert Audio Mono is an Agent Skill for documents published in the jackfranklin/dotfiles repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Use when the user wants to convert a video or audio file's stereo audio to mono, or fix audio that only plays in one ear.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/jackfranklin/dotfiles/blob/HEAD/claude/skills/convert-audio-mono/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/convert-audio-mono, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Convert Audio to Mono
Overview
This skill converts the stereo audio channel of a media file (typically video or audio) to mono. It optimizes the process by copying the video stream without re-encoding to preserve video quality, and handles silent channels by extracting the active channel rather than a simple downmix.
When to Use
Use when a video or audio file's sound plays in only one ear/channel, or when a mono mix is requested.
Core Pattern
- Analyze Channel Volumes:
Run
ffmpeg -i <input> -filter_complex "[0:a]astats=metadata=1" -f null -to identify the peak and RMS volume of each channel. Note: Do not usereset=1in the filter, as it resets stats per frame. - Determine Extraction Strategy:
- If one channel is silent (volume ~ -90 dB or less) and the other has sound, isolate the active channel to avoid a 6 dB volume drop from normal averaging:
- Left channel only:
-af "pan=mono|c0=c0"(orFL) - Right channel only:
-af "pan=mono|c0=c1"(orFR)
- Left channel only:
- If both channels have active sound, use standard downmixing:
-ac 1
- If one channel is silent (volume ~ -90 dB or less) and the other has sound, isolate the active channel to avoid a 6 dB volume drop from normal averaging:
- Execute Conversion:
Run ffmpeg, copying the video stream to save time and preserve quality:
ffmpeg -i <input> -c:v copy -af "<filter>" -c:a aac -b:a 256k <output>
Common Mistakes
- Re-encoding video: Re-encoding the video stream degrades quality and takes significant time. Always use
-c:v copy. - Averaging silent channels: A simple
-ac 1downmix of a one-eared track averages it with silence, dropping the overall volume by 6 dB. Always analyze first and use thepanfilter for single-channel isolation.