@Test public void shouldCalculateCorrectMean(){ HashMap<Path, Double> means = new HashMap<>(); means.put(new File("a").toPath(), 0.435); means.put(new File("b").toPath(), -13.435); means.put(new File("c").toPath(), -25.435); means.put(new File("d").toPath(), 0.135); Double mean = normalizeAudio.getMeanOfMeans(means); assertThat(mean).isEqualTo(-9.6); }
public Double getMeanOfMeans(Map<Path, Double> meanVolumeMap) { int count = 0; Double meansum = 0.0; for (Double mean : meanVolumeMap.values()) { meansum = meansum + mean; count = count + 1; } Double unRoundedNumber = meansum / (double) count; return (double) Math.round(unRoundedNumber * 10) / 10; }
NormalizeAudio { public Double getMeanOfMeans(Map<Path, Double> meanVolumeMap) { int count = 0; Double meansum = 0.0; for (Double mean : meanVolumeMap.values()) { meansum = meansum + mean; count = count + 1; } Double unRoundedNumber = meansum / (double) count; return (double) Math.round(unRoundedNumber * 10) / 10; } }
NormalizeAudio { public Double getMeanOfMeans(Map<Path, Double> meanVolumeMap) { int count = 0; Double meansum = 0.0; for (Double mean : meanVolumeMap.values()) { meansum = meansum + mean; count = count + 1; } Double unRoundedNumber = meansum / (double) count; return (double) Math.round(unRoundedNumber * 10) / 10; }  }
NormalizeAudio { public Double getMeanOfMeans(Map<Path, Double> meanVolumeMap) { int count = 0; Double meansum = 0.0; for (Double mean : meanVolumeMap.values()) { meansum = meansum + mean; count = count + 1; } Double unRoundedNumber = meansum / (double) count; return (double) Math.round(unRoundedNumber * 10) / 10; }  double normalizeLoopFiles(String directory); double normalizeFilesInADirectory(String directory); void cleanup(String directoryPath); List<Path> renameToProcessing(String directoryPath); List<Path> getWavPathsFromDirectory(String directoryPath); List<Path> getProcessingPathsFromWavPaths(List<Path> wavPaths); Map<Path, Double> renameToProcessing(Map<Path, Double> wavPaths, List<Path> alreadyRenamed); HashMap<Path, Double> createMeanVolumeMap(List<Path> paths); void normalize(Map<Path, Double> meanVolumeMap, double targetMean, String directory); void normalizeToTarget(Map<Path, Double> meandddOffSets, List<Path> alreadyAdjusted, List<Path> alreadyRenamed); Double getMeanOfMeans(Map<Path, Double> meanVolumeMap); HashMap<Path, Double> calculateMeanOffset(Double target, Map<Path, Double> meanVolumeMap); boolean meansWithinTargetRange(Double target, Map<Path, Double> means); boolean meanIsWithinTargetRange(Double target, Double mean); void normalizeMix(String mixFilePath, String mixFileName, int numOfGeneratedMixes); }
NormalizeAudio { public Double getMeanOfMeans(Map<Path, Double> meanVolumeMap) { int count = 0; Double meansum = 0.0; for (Double mean : meanVolumeMap.values()) { meansum = meansum + mean; count = count + 1; } Double unRoundedNumber = meansum / (double) count; return (double) Math.round(unRoundedNumber * 10) / 10; }  double normalizeLoopFiles(String directory); double normalizeFilesInADirectory(String directory); void cleanup(String directoryPath); List<Path> renameToProcessing(String directoryPath); List<Path> getWavPathsFromDirectory(String directoryPath); List<Path> getProcessingPathsFromWavPaths(List<Path> wavPaths); Map<Path, Double> renameToProcessing(Map<Path, Double> wavPaths, List<Path> alreadyRenamed); HashMap<Path, Double> createMeanVolumeMap(List<Path> paths); void normalize(Map<Path, Double> meanVolumeMap, double targetMean, String directory); void normalizeToTarget(Map<Path, Double> meandddOffSets, List<Path> alreadyAdjusted, List<Path> alreadyRenamed); Double getMeanOfMeans(Map<Path, Double> meanVolumeMap); HashMap<Path, Double> calculateMeanOffset(Double target, Map<Path, Double> meanVolumeMap); boolean meansWithinTargetRange(Double target, Map<Path, Double> means); boolean meanIsWithinTargetRange(Double target, Double mean); void normalizeMix(String mixFilePath, String mixFileName, int numOfGeneratedMixes); @Autowired
    public AppConfigs appConfigs; }