TTS 返回语音优化
This commit is contained in:
@@ -114,11 +114,14 @@ public class ChatWebSocketHandler {
|
||||
Map<String,String> mapResult = JSONUtil.toBean(JSONUtil.parseObj(message),Map.class);
|
||||
String resultFlag = mapResult.get("msg");
|
||||
if("done".equals(resultFlag)){
|
||||
|
||||
//发送消息
|
||||
WebSocket webSocket = cacheWebSocket.get(clientId);
|
||||
if(webSocket != null){
|
||||
webSocket.close(1000,null);
|
||||
}
|
||||
webSocket.send("{\"type\": \"input_audio_buffer.commit\"}");
|
||||
webSocket.send("{\"type\": \"response.create\"}");
|
||||
// if(webSocket != null){
|
||||
// webSocket.close(1000,null);
|
||||
// }
|
||||
//语音结束,开始进行回答解析
|
||||
String cacheResultText = cacheClientTts.get(clientId);
|
||||
log.info("1、开始进行AI回答时间:{}",System.currentTimeMillis()/1000);
|
||||
|
||||
Reference in New Issue
Block a user