|
|
@@ -233,8 +233,6 @@ public class WebSocketHandler extends AbstractWebSocketHandler {
|
|
|
* @return void
|
|
|
*/
|
|
|
private void measureCompare(String phone, int measureIndex) throws IOException {
|
|
|
- //总分
|
|
|
- BigDecimal score = BigDecimal.ZERO;
|
|
|
//相似度
|
|
|
BigDecimal intonation = BigDecimal.ZERO;
|
|
|
//节奏
|
|
|
@@ -254,16 +252,16 @@ public class WebSocketHandler extends AbstractWebSocketHandler {
|
|
|
//音准匹配数量
|
|
|
float intonationNum = 0;
|
|
|
//音准匹配误差范围
|
|
|
- float intonationErrRange = 10;
|
|
|
+ float intonationErrRange = 15;
|
|
|
//音准有效阈值
|
|
|
- float intonationValidDuty = 0.5f;
|
|
|
+ float intonationValidDuty = 0.7f;
|
|
|
|
|
|
//节奏匹配数量
|
|
|
float cadenceNum = 0;
|
|
|
//节奏匹配误差范围
|
|
|
- float cadenceErrRange = 100;
|
|
|
+ float cadenceErrRange = 30;
|
|
|
//节奏有效阈值
|
|
|
- float cadenceValidDuty = 0.5f;
|
|
|
+ float cadenceValidDuty = 0.6f;
|
|
|
|
|
|
int totalCompareNum = userSoundInfoMap.get(phone).getMeasureXmlInfoMap().get(measureIndex).size();
|
|
|
|
|
|
@@ -398,6 +396,7 @@ public class WebSocketHandler extends AbstractWebSocketHandler {
|
|
|
webSocketInfo.setHeader(header);
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
BigDecimal score = intonation.multiply(new BigDecimal(0.5)).add(cadence.multiply(new BigDecimal(0.5))).setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
+// BigDecimal score = cadence.setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
result.put("score", score);
|
|
|
result.put("intonation", intonation);
|
|
|
result.put("cadence", cadence);
|