|
@@ -156,7 +156,7 @@ public class SoundServiceImpl implements SoundService {
|
|
|
BigDecimal l_s = new BigDecimal(0);
|
|
|
BigDecimal l_r = new BigDecimal(0);
|
|
|
|
|
|
- String filePath_r = FileUtils.getTempDirectoryPath()+ idGeneratorService.generatorId("sound") + "_r.mp3";
|
|
|
+ String filePath_r = FileUtils.getTempDirectoryPath()+ idGeneratorService.generatorId("sound") + "_r.wav";
|
|
|
f_r = new File(filePath_r);
|
|
|
FileUtils.copyToFile(record.getInputStream(), f_r);
|
|
|
|
|
@@ -186,6 +186,9 @@ public class SoundServiceImpl implements SoundService {
|
|
|
if(pitchGap>pitch1){
|
|
|
pitchGap = pitch1;
|
|
|
}
|
|
|
+ if(pitchGap<15){
|
|
|
+ pitchGap = 0;
|
|
|
+ }
|
|
|
allPitchGap+=pitchGap;
|
|
|
pitchSize+=pitch1;
|
|
|
}
|
|
@@ -210,8 +213,9 @@ public class SoundServiceImpl implements SoundService {
|
|
|
}
|
|
|
double cadence_d = 0;
|
|
|
sameTimes = sameTimes>times_r.size()?times_r.size():sameTimes;
|
|
|
+ int allTimes = times_s.size()>times_r.size()?times_r.size():times_s.size();
|
|
|
if (times_r.size()>0){
|
|
|
- cadence_d = sameTimes/times_r.size();
|
|
|
+ cadence_d = sameTimes/allTimes;
|
|
|
}
|
|
|
cadence = new BigDecimal(cadence_d).multiply(oneHandred).setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
|