@Test public void shouldCreateMapOfMeans() throws InterruptedException { assertThat(new File(ORIGINAL_PATH)).exists(); List<Map<String, Double>> volumeMeans = volumeExtractor.getVolumeMeans(Arrays.asList(roleToFileMap)); assertThat(volumeMeans.get(0).get(keyOne)).isEqualTo(-25.4); assertThat(volumeMeans.get(0).get(keyTwo)).isEqualTo(-34.0); assertThat(volumeMeans.get(0).get(keyThree)).isEqualTo(-25.1); assertThat(volumeMeans.get(0).get(keyFour)).isEqualTo(-24.9); assertThat(volumeMeans.get(0).get(keyFive)).isEqualTo(-24.4); }
public List<Map<String, Double>> getVolumeMeans(List<Map<String, File>> roleToFileMaps) { List<Map<String, Double>> roleToMeanMapList = new ArrayList<>(); for(Map<String, File> roleToFileMap : roleToFileMaps) { Map<String, Double> roleToMeanMap = new HashMap<>(); for (Map.Entry<String, File> entry : roleToFileMap.entrySet()) { try { double mean = audioUtils.getMeanVolume(entry.getValue()); roleToMeanMap.put(entry.getKey(), mean); } catch (InterruptedException e) { Application.logger.debug("LOG:", e); } } roleToMeanMapList.add(roleToMeanMap); } return roleToMeanMapList; }
VolumeExtractor { public List<Map<String, Double>> getVolumeMeans(List<Map<String, File>> roleToFileMaps) { List<Map<String, Double>> roleToMeanMapList = new ArrayList<>(); for(Map<String, File> roleToFileMap : roleToFileMaps) { Map<String, Double> roleToMeanMap = new HashMap<>(); for (Map.Entry<String, File> entry : roleToFileMap.entrySet()) { try { double mean = audioUtils.getMeanVolume(entry.getValue()); roleToMeanMap.put(entry.getKey(), mean); } catch (InterruptedException e) { Application.logger.debug("LOG:", e); } } roleToMeanMapList.add(roleToMeanMap); } return roleToMeanMapList; } }
VolumeExtractor { public List<Map<String, Double>> getVolumeMeans(List<Map<String, File>> roleToFileMaps) { List<Map<String, Double>> roleToMeanMapList = new ArrayList<>(); for(Map<String, File> roleToFileMap : roleToFileMaps) { Map<String, Double> roleToMeanMap = new HashMap<>(); for (Map.Entry<String, File> entry : roleToFileMap.entrySet()) { try { double mean = audioUtils.getMeanVolume(entry.getValue()); roleToMeanMap.put(entry.getKey(), mean); } catch (InterruptedException e) { Application.logger.debug("LOG:", e); } } roleToMeanMapList.add(roleToMeanMap); } return roleToMeanMapList; } @Autowired  VolumeExtractor(IAudioUtils audioUtils); }
VolumeExtractor { public List<Map<String, Double>> getVolumeMeans(List<Map<String, File>> roleToFileMaps) { List<Map<String, Double>> roleToMeanMapList = new ArrayList<>(); for(Map<String, File> roleToFileMap : roleToFileMaps) { Map<String, Double> roleToMeanMap = new HashMap<>(); for (Map.Entry<String, File> entry : roleToFileMap.entrySet()) { try { double mean = audioUtils.getMeanVolume(entry.getValue()); roleToMeanMap.put(entry.getKey(), mean); } catch (InterruptedException e) { Application.logger.debug("LOG:", e); } } roleToMeanMapList.add(roleToMeanMap); } return roleToMeanMapList; } @Autowired  VolumeExtractor(IAudioUtils audioUtils); List<Map<String, Double>> getVolumeMeans(List<Map<String, File>> roleToFileMaps); }
VolumeExtractor { public List<Map<String, Double>> getVolumeMeans(List<Map<String, File>> roleToFileMaps) { List<Map<String, Double>> roleToMeanMapList = new ArrayList<>(); for(Map<String, File> roleToFileMap : roleToFileMaps) { Map<String, Double> roleToMeanMap = new HashMap<>(); for (Map.Entry<String, File> entry : roleToFileMap.entrySet()) { try { double mean = audioUtils.getMeanVolume(entry.getValue()); roleToMeanMap.put(entry.getKey(), mean); } catch (InterruptedException e) { Application.logger.debug("LOG:", e); } } roleToMeanMapList.add(roleToMeanMap); } return roleToMeanMapList; } @Autowired  VolumeExtractor(IAudioUtils audioUtils); List<Map<String, Double>> getVolumeMeans(List<Map<String, File>> roleToFileMaps);  }