STT逻辑修改
This commit is contained in:
@@ -143,8 +143,9 @@ public class ChatWebSocketHandler {
|
|||||||
}
|
}
|
||||||
String startFlag = cacheReplyFlag.get(session.getId());
|
String startFlag = cacheReplyFlag.get(session.getId());
|
||||||
//语音结束,开始进行回答解析
|
//语音结束,开始进行回答解析
|
||||||
|
log.info("开始文本处理,客户端ID为:{}",clientId);
|
||||||
String cacheResultText = cacheClientTts.get(clientId);
|
String cacheResultText = cacheClientTts.get(clientId);
|
||||||
log.info("面试者回答信息为:{}", cacheResultText);
|
log.info("开始文本处理,面试者回答信息为:{}", cacheResultText);
|
||||||
if (StrUtil.isEmpty(cacheResultText)) {
|
if (StrUtil.isEmpty(cacheResultText)) {
|
||||||
cacheResultText = "I first check the forklift's logbook for recent issues, inspect tires and brakes, verify the load capacity matches today's task, and confirm my licence is current—all per SWMS requirements.";
|
cacheResultText = "I first check the forklift's logbook for recent issues, inspect tires and brakes, verify the load capacity matches today's task, and confirm my licence is current—all per SWMS requirements.";
|
||||||
}
|
}
|
||||||
@@ -471,7 +472,7 @@ public class ChatWebSocketHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMessage(WebSocket webSocket, String text) {
|
public void onMessage(WebSocket webSocket, String text) {
|
||||||
System.out.println("📩 收到转录结果: " + text);
|
// System.out.println("📩 收到转录结果: " + text);
|
||||||
//对数据进行解析
|
//对数据进行解析
|
||||||
if (StrUtil.isNotEmpty(text)) {
|
if (StrUtil.isNotEmpty(text)) {
|
||||||
Map<String, String> mapResultData = JSONUtil.toBean(text, Map.class);
|
Map<String, String> mapResultData = JSONUtil.toBean(text, Map.class);
|
||||||
@@ -484,6 +485,7 @@ public class ChatWebSocketHandler {
|
|||||||
} else {
|
} else {
|
||||||
cacheString = resultText;
|
cacheString = resultText;
|
||||||
}
|
}
|
||||||
|
log.info("收到转录结果:{}","客户端ID为:"+clientId+",转录结果:"+resultText);
|
||||||
cacheClientTts.put(clientId, cacheString);
|
cacheClientTts.put(clientId, cacheString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user