[#13] Add audio preprocessing for uploaded recordings#33
Merged
Conversation
…oudness normalization
Member
Author
QA Confidence VerdictWhat Was VerifiedTruths:
Acceptance Criteria:
Tests: All 30 tests pass (5 unit tests for preprocessor, 2 integration tests for preprocess_audio persistence). What Needs Human Eyes
Risk Areas
Suggested QA Focus
|
CI does not install ML dependencies. Use pytest.importorskip to gracefully skip when numpy/soundfile/noisereduce are unavailable.
soundfile (libsndfile) cannot read m4a/AAC files, causing preprocessing to fail on common upload formats. Convert unsupported formats to WAV using ffmpeg before applying filters.
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.
Story: #13
Summary
Add an audio preprocessing pipeline that automatically cleans uploaded audio before transcription. The pipeline applies three stages: 80Hz high-pass filter (removes rumble), conservative noise reduction via
noisereduce(prop_decrease=0.75), and loudness normalization to -23 LUFS viapyloudnorm. Preprocessing is enabled by default and can be toggled off per upload via a new checkbox in the upload form.Key changes:
backend/services/audio_preprocessor.pyservice with the three-stage pipelinepreprocess_audioboolean field added toMeetingMetadata(defaults toTrue)preprocess_audioform parameterfinallyblock after transcriptionnoisereduce>=3.0.0,pyloudnorm>=0.1.1Approach
Preprocessing is implemented as a separate service module to keep the transcriber focused on transcription. The preprocessed audio is saved as a WAV working copy alongside the original file (preserving the original per T3). Conservative noise reduction settings are used because Whisper was trained on noisy data (BR-3/T1). The preprocessed copy is fed to both transcription and diarization (T2).
Verification
pytest -x -q)preprocess_audiodefaults to true, can be disabled via form field