Explorar el Código

feat:智能陪练一期

Joburgess hace 4 años
padre
commit
7f4bcb95ba

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SoundCheckHandler.java

@@ -72,6 +72,9 @@ public class SoundCheckHandler implements WebSocketEventHandler {
         try {
             AudioDispatcher dispatcher = AudioDispatcherFactory.fromByteArray(message.getPayload().array(), SoundCompareHandler.soundCompareConfig.audioFormat, SoundCompareHandler.soundCompareConfig.simpleSize, SoundCompareHandler.soundCompareConfig.overlap);
             dispatcher.addAudioProcessor(new PitchProcessor(SoundCompareHandler.soundCompareConfig.algo, SoundCompareHandler.soundCompareConfig.simpleRate, SoundCompareHandler.soundCompareConfig.simpleSize, (pitchDetectionResult, audioEvent) -> {
+                if(!userSoundCheckInfo.containsKey(phone)){
+                    return;
+                }
                 if(pitchDetectionResult.getPitch()<=0){
                     return;
                 }