|  | @@ -140,10 +140,10 @@ public class WebSocketHandler extends AbstractWebSocketHandler {
 | 
	
		
			
				|  |  |                  createHeader(phone);
 | 
	
		
			
				|  |  |                  break;
 | 
	
		
			
				|  |  |              case SoundSocketService.PROXY_MESSAGE:
 | 
	
		
			
				|  |  | -                if(bodyObject.containsKey(SoundSocketService.OFFSET_TIME)){
 | 
	
		
			
				|  |  | -                    int offsetTime = bodyObject.getIntValue(SoundSocketService.OFFSET_TIME);
 | 
	
		
			
				|  |  | -                    calOffsetTime(phone, offsetTime);
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | +//                if(bodyObject.containsKey(SoundSocketService.OFFSET_TIME)){
 | 
	
		
			
				|  |  | +//                    int offsetTime = bodyObject.getIntValue(SoundSocketService.OFFSET_TIME);
 | 
	
		
			
				|  |  | +//                    calOffsetTime(phone, offsetTime);
 | 
	
		
			
				|  |  | +//                }
 | 
	
		
			
				|  |  |                  break;
 | 
	
		
			
				|  |  |              default:
 | 
	
		
			
				|  |  |                  break;
 | 
	
	
		
			
				|  | @@ -160,21 +160,16 @@ public class WebSocketHandler extends AbstractWebSocketHandler {
 | 
	
		
			
				|  |  |              userSoundInfoMap.get(phone).getAccessFile().write(message.getPayload().array());
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        List<MusicPitchDetailDto> recordInfo = new ArrayList<>();
 | 
	
		
			
				|  |  |          AudioDispatcher dispatcher = AudioDispatcherFactory.fromByteArray(message.getPayload().array(), audioFormat, simpleSize, overlap);
 | 
	
		
			
				|  |  |          dispatcher.addAudioProcessor(silenceDetecor);
 | 
	
		
			
				|  |  |          dispatcher.addAudioProcessor(new PitchProcessor(algo, simpleRate, simpleSize, (pitchDetectionResult, audioEvent) -> {
 | 
	
		
			
				|  |  |              int timeStamp = (int) (userSoundInfoMap.get(phone).getMeasureStartTime() + audioEvent.getTimeStamp()*1000);
 | 
	
		
			
				|  |  |              float pitch = pitchDetectionResult.getPitch();
 | 
	
		
			
				|  |  | -            double cents = 0;
 | 
	
		
			
				|  |  | -            if (pitch > 0) {
 | 
	
		
			
				|  |  | -                cents = PitchConverter.hertzToAbsoluteCent(pitch);
 | 
	
		
			
				|  |  | +            if(pitch>0 && userSoundInfoMap.get(phone).getOffsetTime() == -1){
 | 
	
		
			
				|  |  | +                calOffsetTime(phone, (int) (CollectionUtils.isEmpty(userSoundInfoMap.get(phone).getRecordMeasurePithInfo())?0:userSoundInfoMap.get(phone).getRecordMeasurePithInfo().get(userSoundInfoMap.get(phone).getRecordMeasurePithInfo().size()-1).getTimeStamp()));
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  //            LOGGER.info("时间:{}, 频率:{}, 分贝:{}, 音分:{}", timeStamp, pitch, silenceDetecor.currentSPL(), cents);
 | 
	
		
			
				|  |  | -//            if (silenceDetecor.currentSPL() < -66){
 | 
	
		
			
				|  |  | -//                pitch = -1;
 | 
	
		
			
				|  |  | -//            }
 | 
	
		
			
				|  |  | -            recordInfo.add(new MusicPitchDetailDto(timeStamp, pitch, silenceDetecor.currentSPL()));
 | 
	
		
			
				|  |  | +            userSoundInfoMap.get(phone).getRecordMeasurePithInfo().add(new MusicPitchDetailDto(timeStamp, pitch, silenceDetecor.currentSPL()));
 | 
	
		
			
				|  |  |          }));
 | 
	
		
			
				|  |  |          dispatcher.run();
 | 
	
		
			
				|  |  |          if(Objects.isNull(userSoundInfoMap.get(phone).getAccessFile())){
 | 
	
	
		
			
				|  | @@ -183,13 +178,10 @@ public class WebSocketHandler extends AbstractWebSocketHandler {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          double recordTime = userSoundInfoMap.get(phone).getAccessFile().length()/(audioFormat.getFrameSize()*audioFormat.getFrameRate())*1000;
 | 
	
		
			
				|  |  |          userSoundInfoMap.get(phone).setMeasureStartTime(recordTime);
 | 
	
		
			
				|  |  | -        userSoundInfoMap.get(phone).getRecordMeasurePithInfo().addAll(recordInfo);
 | 
	
		
			
				|  |  |          for (Map.Entry<Integer, MusicPitchDetailDto> userMeasureEndTimeMapEntry : userSoundInfoMap.get(phone).getMeasureEndTime().entrySet()) {
 | 
	
		
			
				|  |  |              int ot = (int) (userMeasureEndTimeMapEntry.getValue().getDuration()*0.1);
 | 
	
		
			
				|  |  |              if(recordTime>(userMeasureEndTimeMapEntry.getValue().getEndTimeStamp()+ot)){
 | 
	
		
			
				|  |  | -//                LOGGER.info("频分开始{}:{}, {}, {}", recordTime, userSoundInfoMap.get(phone).getAccessFile().length(), ot, JSON.toJSONString(userMeasureEndTimeMapEntry.getValue()));
 | 
	
		
			
				|  |  |                  measureCompare(phone, userMeasureEndTimeMapEntry.getKey());
 | 
	
		
			
				|  |  | -//                measureCompare2(phone, userMeasureEndTimeMapEntry.getValue());
 | 
	
		
			
				|  |  |                  userSoundInfoMap.get(phone).getMeasureEndTime().remove(userMeasureEndTimeMapEntry.getKey());
 | 
	
		
			
				|  |  |                  break;
 | 
	
		
			
				|  |  |              }
 | 
	
	
		
			
				|  | @@ -279,6 +271,10 @@ public class WebSocketHandler extends AbstractWebSocketHandler {
 | 
	
		
			
				|  |  |       * @return void
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      private void measureCompare(String phone, int measureIndex) throws IOException {
 | 
	
		
			
				|  |  | +        if (userSoundInfoMap.get(phone).getOffsetTime() == -1){
 | 
	
		
			
				|  |  | +            userSoundInfoMap.get(phone).setOffsetTime(0);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          //相似度
 | 
	
		
			
				|  |  |          BigDecimal intonation = BigDecimal.ZERO;
 | 
	
		
			
				|  |  |          //节奏
 |