static IEnumerable<ComparisonAgregator> CompareBySamples(WaveReader originalReader, WaveReader compressedReader, long compressedSamplesToSkip) { var comparisonAgregator = new ComparisonAgregator ("All samples", 0); EnumerateBySamples (originalReader, compressedReader, compressedSamplesToSkip, comparisonAgregator.DetermineEquilization); EnumerateBySamples (originalReader, compressedReader, compressedSamplesToSkip, comparisonAgregator.CompareSamples); comparisonAgregator.WriteResults (); yield return comparisonAgregator; }
static IEnumerable<ComparisonAgregator> CompareByFrequencyBands(WaveReader originalReader, WaveReader compressedReader, long compressedSamplesToSkip) { var highComparisonAgregator = new ComparisonAgregator ("High Frequencies: > 6khz", 0); var midComparisonAgregator = new ComparisonAgregator ("Mid Frequencies: < 6khz, > 3khz", 1); var lowComparisonAgregator = new ComparisonAgregator ("Low Frequencies: < 3khz", 2); EnumerateByFrequencyBands ( originalReader, compressedReader, compressedSamplesToSkip, highComparisonAgregator.DetermineEquilization, midComparisonAgregator.DetermineEquilization, lowComparisonAgregator.DetermineEquilization); EnumerateByFrequencyBands ( originalReader, compressedReader, compressedSamplesToSkip, highComparisonAgregator.CompareSamples, midComparisonAgregator.CompareSamples, lowComparisonAgregator.CompareSamples); lowComparisonAgregator.WriteResults (); midComparisonAgregator.WriteResults (); highComparisonAgregator.WriteResults (); yield return lowComparisonAgregator; yield return midComparisonAgregator; yield return highComparisonAgregator; }