Repository navigation
fix(audio_mixer): stop forcing 16 kHz mono PCM in extract - #577
Merged
calesthio merged 2 commits intoNov 8, 2026
Merged
Conversation
Two cases against `_extract`. The command must not pin a sample rate or channel count, and must not push `pcm_s16le` into an m4a container. Both fail today. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016K9spmyzHH5qkwvnxH573h
Drop `-acodec pcm_s16le -ar 16000 -ac 1` from `_extract` and let the muxer pick the codec for the requested container. The flags were a speech preset on an operation documented only as "extract audio from video file", so a music or effects bed lost half its spectrum and its stereo image, and any container but WAV failed on `Could not find tag for codec pcm_s16le`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016K9spmyzHH5qkwvnxH573h
pavelhov
pushed a commit
to pavelhov/OpenMontage
that referenced
this pull request
Sep 7, 2026
Adapt calesthio/OpenMontage PRs OpenMontageInc#598, OpenMontageInc#606, OpenMontageInc#573, OpenMontageInc#577, OpenMontageInc#625, and OpenMontageInc#634 with regression coverage. Extract subtitle-disable behavior from OpenMontageInc#629 and the local-first runtime idea from OpenMontageInc#614, preserving host environment options and consistent CLI selection. Keep source-frame directories distinct by full path, preserve SRT cue boundaries, and prevent reference filenames from clipping on mobile. Exclude duplicated and unrelated additions in OpenMontageInc#641 and OpenMontageInc#613. Co-authored-by: Arnaud Chretien <achretien22@gmail.com> Co-authored-by: Algoritim Bilişim <iletisim@algoritimbilisim.com> Co-authored-by: xp <xue_yun@foxmail.com> Co-authored-by: Pablo Araya <arayap812@gmail.com> Co-authored-by: Bakary Gibba <162592884+BakaryGibba@users.noreply.github.com> Co-authored-by: kraaft007 <63367797+kraaft007@users.noreply.github.com> Co-authored-by: Oğuzhan Filiz <oguzhanfiliz3@gmail.com> Co-authored-by: gaobenchang <gaobenchang@users.noreply.localhost>
calesthio
approved these changes
Nov 7, 2026
calesthio
left a comment
Collaborator
There was a problem hiding this comment.
Thank you for removing the speech-specific extraction preset from general audio extraction. Reviewed the complete diff against main 63d1087a. Validation: supplied focused tests 2 passed, plus actual FFmpeg extraction of a stereo 48 kHz fixture into WAV, M4A and MP3. ffprobe confirmed 48 kHz/stereo in all three, with the appropriate PCM/AAC/MP3 encoder chosen by each container. This fixes the accidental mono/16 kHz restriction; it does not promise bit-identical audio for lossy output formats.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
audio_mixer'sextractoperation hardcoded a speech/STT preset onto every call. Any caller extracting a music or effects bed silently got 16 kHz mono, and any output container other than WAV failed outright. The schema documents the operation only as "extract audio from video file", so nothing warned the caller.Related issue
Refs none. Found while mixing a montage's native audio.
Changes
tools/audio/audio_mixer.py:_extractdrops-acodec pcm_s16le -ar 16000 -ac 1and lets the muxer pick the codec for the requested container.tests/tools/test_audio_mixer_extract_fidelity.py: asserts the command pins neither sample rate nor channel count, and does not pushpcm_s16leinto an m4a container.Two failures from one preset
Fidelity: a 48 kHz stereo source came back 16 kHz mono. Half the spectrum and the stereo image, gone with no warning. Fine for Whisper, wrong for a mix bus.
Containers:
pcm_s16lecannot be muxed into m4a. Extracting to anything but WAV died onCould not find tag for codec pcm_s16le in stream #0, codec not currently supported in container.No caller in the repo depends on the old behavior.
extractis reachable only through the operation dispatch, andtranscriberdoes not route through it.Tradeoffs
A caller that genuinely wants 16 kHz mono for speech now has to ask for it. No such caller exists in the repo, so I did not add parameters for a hypothetical one.
Blast Radius
One function, no in-repo callers. Anyone calling
extractfor STT gets a higher-fidelity file than before, which the downstream model resamples anyway.Testing
pytest tests/tools/test_audio_mixer_extract_fidelity.py— 2 failed before, 2 passed after.pytest tests/tools tests/contracts— 1750 passed, 7 skipped, 3 xfailed.pcm_s16le,44100,2for WAV andaac,44100,2for m4a.Checklist