|
@@ -163,6 +163,7 @@ public class SoundCompareHandler implements WebSocketEventHandler {
|
|
|
}
|
|
|
try {
|
|
|
if(!CollectionUtils.isEmpty(userSoundInfoMap.get(phone).getMeasureEndTime())){
|
|
|
+ //这是最后播放的一小节吗?
|
|
|
Integer lastMeasureIndex = userSoundInfoMap.get(phone).getMeasureEndTime().keySet().stream().min(Integer::compareTo).get();
|
|
|
double recordTime = userSoundInfoMap.get(phone).getAccessFile().length()/(soundCompareConfig.audioFormat.getFrameSize()*soundCompareConfig.audioFormat.getFrameRate())*1000;
|
|
|
//如果结束时时长大于某小节,则此小节需要评分
|
|
@@ -364,6 +365,7 @@ public class SoundCompareHandler implements WebSocketEventHandler {
|
|
|
int ot5 = (int) (musicXmlInfo.getDuration()*0.22<70?70:musicXmlInfo.getDuration()*0.22);
|
|
|
int rightTimeRange = ot5>200?200:ot5;
|
|
|
|
|
|
+ // 待优化:结束时间应该是加偏移量
|
|
|
List<MusicPitchDetailDto> recordPitchs = userSoundInfoMap.get(phone).getRecordMeasurePitchInfos().stream().filter(m -> m.getTimeStamp()>=startTimeStamp-rightTimeRange && m.getTimeStamp() < endTimeStamp-rightTimeRange).collect(Collectors.toList());
|
|
|
|
|
|
boolean cadenceRight = false;
|
|
@@ -409,10 +411,10 @@ public class SoundCompareHandler implements WebSocketEventHandler {
|
|
|
|
|
|
intonationScore += score;
|
|
|
musicXmlInfo.setAvgFrequency(avgPitch);
|
|
|
- intonationRight = score>70;
|
|
|
+ intonationRight = score>70; //大于70分音准才正确?????
|
|
|
|
|
|
integrityScore += integrityDuty;
|
|
|
- integrityRight = integrityDuty>0.7;
|
|
|
+ integrityRight = integrityDuty>0.7;//大于70%完整性才正确????
|
|
|
}
|
|
|
|
|
|
//如果当前音符不需要演奏
|