Added audio normalization#307
Draft
tombogle wants to merge 44 commits into
Draft
Conversation
Passing the PublishingModel into the PublishingMethodBase.PublishChapter method
Removed extra copy of lame from Installer
…rthis into audio-normalization
correct names of boxes in post processing UI save values from post processing UI in model
add region to improve readability
start pause constraining
…rect to fix testing errors
…rthis into audio-normalization
…rthis into audio-normalization
…ise-reduced audio
Post-Processing Functionality
# Conflicts: # src/HearThis/HearThis.csproj
# Conflicts: # src/HearThis/HearThis.csproj # src/HearThis/Publishing/PublishDialog.cs # src/HearThis/Publishing/PublishingModel.cs
…gs related to audio normalization. Not yet tested.
Contributor
Author
|
Run the "finished product" by Jerry Walker (MD & S) for suggestions for improvement. |
… during export - Replaced the disabled paragraph/section pause placeholder blocks in ClipRepository.MergeAudioFiles with a single per-clip loop that picks the applicable pause settings (clip, paragraph, or section) for each boundary, based on script information supplied by a new getScriptLine callback. The callback maps clip file names to block numbers, so gaps from unrecorded, skipped, or invalid clips do not shift the lookup, and extraneous clips degrade gracefully to clip-pause handling. - Added ScriptLine.ParagraphStart, set by ParatextParagraph.BreakIntoBlocks on the first block of each paragraph, to support paragraph pause detection. - Renamed SentencePause to ClipPause throughout (settings interface, model, project settings XML, and Publish dialog controls) to match its actual meaning: the pause between any two consecutive clips. - Reworked noise reduction during merge: silence is now measured on noise-reduced copies of the clips so background noise cannot obscure the pauses. A DOUBLE_PASS_NOISE_REDUCTION define (on by default) controls whether those copies are also joined, giving published audio a per-clip pass — now uniform, including the first clip — in addition to the whole-chapter pass, or whether the chapter pass is the only one that affects published audio. Also fixed ffmpeg filter escaping and path quoting in ReduceNoise. - Publish dialog now initializes the audio normalization controls from persisted settings, saves the choices before the pre-publish problem check, and disables the normalization panel while publishing. - Added release notes entry; minor cleanup in tests. Also, in PublishDialog: - Publish button is now initially disabled and only enabled once an audio format is selected. - All four PauseData constructors read from _numericSectionPauseMin/Max (a copy-paste bug)
- PublishingMethodBase.PublishChapter: enter the post-processing region when only chapter pause constraining is enabled (previously it was silently skipped unless volume normalization or noise reduction was also on), and guard against a null ChapterPause. - ClipRepository.MergeAudioFiles: use null-conditional access in the pause normalization entry condition, and clear all three pause settings (not just ClipPause) on error so subsequent chapters do not re-enter the failing path. - Extract the clip/paragraph/section pause selection logic into ClipRepository.GetPauseToApply so it can be unit tested directly. - Add ClipRepositoryNormalizationTests covering pause selection, MergeAudioFiles pause normalization entry/skip/error paths, and the chapter pause block in PublishingMethodBase. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
tombogle
marked this pull request as ready for review
July 8, 2026 21:26
- Prevent failures when paths contain spaces - Renamed misleading methods - Leading silence detection only counts silence at *start* of the clip - Parsing now uses InvariantCulture - works with comma-decimal locales like German - Improved performace: trailing silence is measured with a single areverse,silencedetect filter chain instead of writing reversed copy to disk - Added tests for GetDurationOfLeadingSilence and GetDurationOfTrailingSilence. - Exclude transient ScriptLine.ParagraphStart field from serialization (with unit test) - One-line (unrelated) code cleanup in LameEncoder.cs
tombogle
force-pushed
the
audio-normalization
branch
from
July 11, 2026 20:38
2a4bc7f to
1fcad5a
Compare
The filter is now simply -af arnndn=m=... It also handles the stereo edge case (per-clip noise reduction runs before the mono conversion, and arnndn processes each channel independently). Output remains 48 kHz exactly as before.
tombogle
marked this pull request as draft
July 17, 2026 20:20
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.
This change is