|
@@ -50,8 +50,6 @@ public class SoundServiceImpl implements SoundService {
|
|
|
@Autowired
|
|
|
private SysMusicScoreDao sysMusicScoreDao;
|
|
|
@Autowired
|
|
|
- private SysMusicScoreAccompanimentDao sysMusicScoreAccompanimentDao;
|
|
|
- @Autowired
|
|
|
private IdGeneratorService idGeneratorService;
|
|
|
|
|
|
/**
|
|
@@ -74,27 +72,6 @@ public class SoundServiceImpl implements SoundService {
|
|
|
return times;
|
|
|
}
|
|
|
|
|
|
- private List<Double> rootMeanSquareExtractor(byte[] bytes, String url) throws UnsupportedAudioFileException {
|
|
|
- List<Double> rootMeans = new ArrayList<>();
|
|
|
- int size = 2048;
|
|
|
- int overlap = 0;
|
|
|
- AudioDispatcher dispatcher = StringUtils.isBlank(url)?getFromByteArray(bytes, size, overlap):getFromFile(url, size, overlap);
|
|
|
-
|
|
|
- dispatcher.addAudioProcessor(new AudioProcessor() {
|
|
|
- @Override
|
|
|
- public void processingFinished() {
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public boolean process(AudioEvent audioEvent) {
|
|
|
- rootMeans.add(audioEvent.getRMS());
|
|
|
- return true;
|
|
|
- }
|
|
|
- });
|
|
|
- dispatcher.run();
|
|
|
- return rootMeans;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* @describe 音频分贝信息提取
|
|
|
* @author Joburgess
|
|
@@ -251,9 +228,9 @@ public class SoundServiceImpl implements SoundService {
|
|
|
if(f!=null){
|
|
|
f.delete();
|
|
|
}
|
|
|
-// if(f_r!=null){
|
|
|
-// f_r.delete();
|
|
|
-// }
|
|
|
+ if(f_r!=null){
|
|
|
+ f_r.deleteOnExit();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
result.put("score", score);
|