@@ -356,88 +356,6 @@ func GenerateReport(data ReportData) error {
356356 return nil
357357}
358358
359- // formatNormalisationResult outputs the loudnorm normalisation pass details
360- func formatNormalisationResult (f * os.File , result * processor.NormalisationResult , config * processor.FilterChainConfig ) {
361- writeSection (f , "Pass 3: Loudnorm Measurement" )
362-
363- if result == nil || ! config .LoudnormEnabled {
364- fmt .Fprintln (f , "Status: DISABLED" )
365- return
366- }
367-
368- if result .Skipped {
369- fmt .Fprintln (f , "Status: SKIPPED" )
370- return
371- }
372-
373- fmt .Fprintln (f , "Status: APPLIED" )
374- fmt .Fprintln (f , "" )
375- fmt .Fprintln (f , "Pre-normalisation (Pass 2 output):" )
376- fmt .Fprintf (f , " Integrated loudness: %.1f LUFS\n " , result .InputLUFS )
377- fmt .Fprintf (f , " True peak: %.1f dBTP\n " , result .InputTP )
378- fmt .Fprintln (f , "" )
379-
380- writeSection (f , "Pass 4: Loudnorm Normalisation" )
381- fmt .Fprintln (f , "" )
382- fmt .Fprintln (f , "Loudnorm configuration:" )
383- if result .LinearModeForced {
384- fmt .Fprintf (f , " Target I: %.1f LUFS (adjusted from %.1f to preserve linear mode)\n " ,
385- result .EffectiveTargetI , result .RequestedTargetI )
386- } else {
387- fmt .Fprintf (f , " Target I: %.1f LUFS\n " , config .LoudnormTargetI )
388- }
389- fmt .Fprintf (f , " Target TP: %.1f dBTP\n " , config .LoudnormTargetTP )
390- fmt .Fprintf (f , " Target LRA: %.1f LU\n " , config .LoudnormTargetLRA )
391- fmt .Fprintf (f , " Mode: %s\n " , loudnormModeString (config .LoudnormLinear ))
392- fmt .Fprintf (f , " Dual mono: %v\n " , config .LoudnormDualMono )
393- fmt .Fprintf (f , " Offset: %+.2f dB\n " , result .GainApplied )
394-
395- // Display loudnorm measurement (from Pass 3, used for Pass 4 parameters)
396- fmt .Fprintln (f , "" )
397- fmt .Fprintln (f , "Loudnorm measurement (from Pass 3):" )
398- fmt .Fprintf (f , " Input I: %.2f LUFS\n " , result .InputLUFS )
399- fmt .Fprintf (f , " Input TP: %.2f dBTP\n " , result .InputTP )
400- fmt .Fprintf (f , " Target Offset: %.2f dB (from loudnorm, used in Pass 4)\n " , result .GainApplied )
401-
402- // Display loudnorm filter's second pass stats (parsed from JSON output)
403- if result .LoudnormStats != nil {
404- stats := result .LoudnormStats
405- fmt .Fprintln (f , "" )
406- fmt .Fprintln (f , "Loudnorm second pass diagnostics:" )
407- fmt .Fprintf (f , " Input I: %s LUFS\n " , stats .InputI )
408- fmt .Fprintf (f , " Input TP: %s dBTP\n " , stats .InputTP )
409- fmt .Fprintf (f , " Input LRA: %s LU\n " , stats .InputLRA )
410- fmt .Fprintf (f , " Input Thresh: %s LUFS\n " , stats .InputThresh )
411- fmt .Fprintf (f , " Output I: %s LUFS\n " , stats .OutputI )
412- fmt .Fprintf (f , " Output TP: %s dBTP\n " , stats .OutputTP )
413- fmt .Fprintf (f , " Output LRA: %s LU\n " , stats .OutputLRA )
414- fmt .Fprintf (f , " Output Thresh: %s LUFS\n " , stats .OutputThresh )
415- fmt .Fprintf (f , " Norm Type: %s\n " , stats .NormalizationType )
416- fmt .Fprintf (f , " Target Offset: %s dB\n " , stats .TargetOffset )
417- }
418-
419- fmt .Fprintln (f , "" )
420- fmt .Fprintln (f , "Post-normalisation:" )
421- fmt .Fprintf (f , " Integrated loudness: %.1f LUFS\n " , result .OutputLUFS )
422- fmt .Fprintf (f , " True peak: %.1f dBTP\n " , result .OutputTP )
423-
424- fmt .Fprintln (f , "" )
425- // Calculate deviation from effective target (what loudnorm was actually targeting)
426- effectiveDeviation := math .Abs (result .OutputLUFS - result .EffectiveTargetI )
427- if result .WithinTarget {
428- if result .LinearModeForced {
429- // Target was adjusted to preserve linear mode
430- requestedDeviation := math .Abs (result .OutputLUFS - result .RequestedTargetI )
431- fmt .Fprintf (f , "Result: ✓ Linear mode preserved (%.2f LU from effective target, %.2f LU from requested)\n " ,
432- effectiveDeviation , requestedDeviation )
433- } else {
434- fmt .Fprintf (f , "Result: ✓ Within target (deviation: %.2f LU)\n " , effectiveDeviation )
435- }
436- } else {
437- fmt .Fprintf (f , "Result: ⚠ Outside tolerance (deviation: %.2f LU)\n " , effectiveDeviation )
438- }
439- }
440-
441359// loudnormModeString converts linear bool to readable mode string
442360func loudnormModeString (linear bool ) string {
443361 if linear {
@@ -682,18 +600,6 @@ func formatNoiseRemoveFilter(f *os.File, cfg *processor.FilterChainConfig, m *pr
682600 cfg .NoiseRemoveCompandKnee )
683601}
684602
685- // joinWithComma joins string slice with comma separator
686- func joinWithComma (items []string ) string {
687- result := ""
688- for i , item := range items {
689- if i > 0 {
690- result += ", "
691- }
692- result += item
693- }
694- return result
695- }
696-
697603// formatDS201GateFilter outputs DS201-inspired gate filter details
698604func formatDS201GateFilter (f * os.File , cfg * processor.FilterChainConfig , m * processor.AudioMeasurements , prefix string ) {
699605 if ! cfg .DS201GateEnabled {
@@ -2443,35 +2349,10 @@ func writeDiagnosticLoudnorm(f *os.File, result *processor.NormalisationResult,
24432349 fmt .Fprintln (f , "" )
24442350}
24452351
2446- // writeDiagnosticAdaptive outputs detailed adaptive parameter diagnostics.
2447- // This section is filled by the existing formatFilterChain function.
2448- // For now, we just write a header - the actual content comes from writeFilterChainApplied.
2449- func writeDiagnosticAdaptive (f * os.File , config * processor.FilterChainConfig , measurements * processor.AudioMeasurements ) {
2450- // The filter chain section already contains adaptive rationale for each filter.
2451- // This function is a placeholder for additional adaptive debugging if needed.
2452- // Currently, all adaptive info is in writeFilterChainApplied.
2453- }
2454-
24552352// getFinalMeasurements safely extracts final measurements from the result.
24562353func getFinalMeasurements (result * processor.ProcessingResult ) * processor.OutputMeasurements {
24572354 if result == nil || result .NormResult == nil {
24582355 return nil
24592356 }
24602357 return result .NormResult .FinalMeasurements
24612358}
2462-
2463- // getFilteredNoise safely extracts filtered noise profile from the result.
2464- func getFilteredNoise (result * processor.ProcessingResult ) * processor.SilenceCandidateMetrics {
2465- if result == nil || result .FilteredMeasurements == nil {
2466- return nil
2467- }
2468- return result .FilteredMeasurements .SilenceSample
2469- }
2470-
2471- // getFinalNoise safely extracts final noise profile from the result.
2472- func getFinalNoise (result * processor.ProcessingResult ) * processor.SilenceCandidateMetrics {
2473- if result == nil || result .NormResult == nil || result .NormResult .FinalMeasurements == nil {
2474- return nil
2475- }
2476- return result .NormResult .FinalMeasurements .SilenceSample
2477- }
0 commit comments