General Audio Editing
General audio operations beyond noise reduction: trimming, transcoding, volume normalization, audio extraction, concatenation, fade in/out, and speed change. All operations use the shared script skills/shared/scripts/audio_ops.py, which wraps ffmpeg with deterministic, reproducible parameters — no ad-hoc command construction.
Input
| Field | Required | Description |
|---|---|---|
| input_file | Yes | Audio or video file path |
| operation | Yes | trim / convert / normalize / extract / concat / fade / speed / denoise / info |
| output_file | No | Default: outputs/<topic>/{name}-{op}.{ext} |
Supported formats: wav / mp3 / m4a / aac / flac. Video containers: mp4 / mkv / mov (for audio extraction).
Output
- Processed audio file (saved into
outputs/<topic>/) - Each operation prints the actual executed ffmpeg command plus the output file's duration, bitrate, channels, and sample rate
Execution Steps
Script path (relative to project root): skills/shared/scripts/audio_ops.py. Every subcommand supports -h.
0. Environment Check + Probe
python skills/shared/scripts/audio_ops.py info input.mp3
The script checks for ffmpeg/ffprobe and gives installation hints if missing. Always run info first to inspect file duration, bitrate, and channels before making changes.
1. Trim
# By start and end time
python skills/shared/scripts/audio_ops.py trim in.mp3 -o outputs/<topic>/clip.mp3 --start 00:00:05 --end 00:00:20
# By start + duration
python skills/shared/scripts/audio_ops.py trim in.mp3 -o clip.mp3 --start 5 --duration 15
2. Convert
python skills/shared/scripts/audio_ops.py convert in.wav -o out.mp3 --bitrate 192k
python skills/shared/scripts/audio_ops.py convert in.m4a -o out.wav --sample-rate 44100 --channels 2
Output format is determined by the file extension (mp3/wav/m4a/aac).
3. Normalize
python skills/shared/scripts/audio_ops.py normalize in.mp3 -o out.mp3
Defaults to loudnorm at -14 LUFS / -1.5 dBTP (common loudness for social media/podcasts). Override with --i, --tp, --lra.
4. Extract
python skills/shared/scripts/audio_ops.py extract video.mp4 -o audio.m4a
python skills/shared/scripts/audio_ops.py extract video.mp4 -o audio.aac --copy # No re-encoding, fastest
5. Concat
python skills/shared/scripts/audio_ops.py concat a.mp3 b.mp3 c.mp3 -o all.mp3
Concatenates in argument order, re-encoding to handle different sample rates/containers.
6. Fade
python skills/shared/scripts/audio_ops.py fade in.mp3 -o out.mp3 --fade-in 2 --fade-out 3
--fade-out automatically positions itself N seconds before the end.
7. Speed (pitch-preserving)
python skills/shared/scripts/audio_ops.py speed in.mp3 -o out.mp3 --factor 1.5 # 1.5x speed
python skills/shared/scripts/audio_ops.py speed in.mp3 -o out.mp3 --factor 0.8 # slow down
Uses atempo to preserve pitch; automatically cascades for factors outside 0.5–2.0.
8. Denoise (fallback; use audio-denoise for dedicated needs)
python skills/shared/scripts/audio_ops.py denoise in.wav -o out.wav --tier 2
Boundary with audio-denoise
- audio-denoise: Dedicated noise reduction SKILL, handles tier selection, model download, and full denoising reports — use it when serious noise removal is needed.
- audio-editing: General-purpose audio processing. The
denoisesubcommand here is only a convenient fallback; both call the sameaudio_ops.py denoiseand have identical capabilities, but different scope.
Rules
- Never delete the original file — only write new files to
outputs/<topic>/. - Always
infobefore processing — display file info to avoid errors. - Video input touches only audio — denoise on video automatically uses
-c:v copy; useextractfor pure audio extraction. - Transparent execution — the script prints the actual ffmpeg command.
- No profile required — audio processing does not depend on user profiles.
Profile Awareness
If a profile is available, default parameters can be adapted (e.g., short-video loudness, target bitrate). Without a profile, it falls back to universal defaults (-14 LUFS, 192k).