关闭算法音频合成
This commit is contained in:
parent
ef5cbad1ef
commit
81699e840e
@ -616,7 +616,7 @@ public class BaseWebSocketProcess {
|
|||||||
log.info("推送Box播放音乐");
|
log.info("推送Box播放音乐");
|
||||||
BoxSession boxSession = getBoxSessionWithSn(baseSession.getSn());
|
BoxSession boxSession = getBoxSessionWithSn(baseSession.getSn());
|
||||||
if(boxSession != null){
|
if(boxSession != null){
|
||||||
sendMsg(baseSession, JSONObject.toJSONString(resp));
|
sendMsg(baseSession, resp);
|
||||||
//记录音乐状态
|
//记录音乐状态
|
||||||
if(resp.getMusic().getPlay().equals(PlayEnum.STOP.getCode())){
|
if(resp.getMusic().getPlay().equals(PlayEnum.STOP.getCode())){
|
||||||
//去掉内存中音乐同步对象
|
//去掉内存中音乐同步对象
|
||||||
@ -660,15 +660,14 @@ public class BaseWebSocketProcess {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return deviceUserTalkRecordService.insertDeviceUserTalkRecord(talkRecord).flatMap(i ->{
|
return deviceUserTalkRecordService.insertDeviceUserTalkRecord(talkRecord).flatMap(i ->{
|
||||||
String msg = JSONObject.toJSONString(resp);
|
|
||||||
if(this instanceof BoxWebSocketHandler){
|
if(this instanceof BoxWebSocketHandler){
|
||||||
log.info("果box聊天记录,同步到客户端");
|
log.info("果box聊天记录,同步到客户端");
|
||||||
BaseSession userSession = getUserSessionWithUserId(baseSession.getUserId());
|
BaseSession userSession = getUserSessionWithUserId(baseSession.getUserId());
|
||||||
if(userSession != null){
|
if(userSession != null){
|
||||||
sendMsg(userSession, msg);
|
sendMsg(userSession, resp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sendMsg(baseSession, msg);
|
sendMsg(baseSession, resp);
|
||||||
|
|
||||||
return Mono.just(true);
|
return Mono.just(true);
|
||||||
});//保存聊天记录
|
});//保存聊天记录
|
||||||
@ -696,8 +695,7 @@ public class BaseWebSocketProcess {
|
|||||||
BoxMessageResp resp = new BoxMessageResp();
|
BoxMessageResp resp = new BoxMessageResp();
|
||||||
resp.setType(type);
|
resp.setType(type);
|
||||||
resp.setText(message);
|
resp.setText(message);
|
||||||
String msg = JSONObject.toJSONString(resp);
|
sendMsg(baseSession, resp);
|
||||||
sendMsg(baseSession, msg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void normalSendMsg(BaseSession baseSession, String message, Integer type, Integer finish){
|
protected void normalSendMsg(BaseSession baseSession, String message, Integer type, Integer finish){
|
||||||
@ -705,18 +703,18 @@ public class BaseWebSocketProcess {
|
|||||||
resp.setType(type);
|
resp.setType(type);
|
||||||
resp.setText(message);
|
resp.setText(message);
|
||||||
resp.getTts().setStatus(finish);
|
resp.getTts().setStatus(finish);
|
||||||
String msg = JSONObject.toJSONString(resp);
|
|
||||||
sendMsg(baseSession, msg);
|
sendMsg(baseSession, resp);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendMsg(BaseSession baseSession, String msg) {
|
private void sendMsg(BaseSession baseSession, BaseMessageResp baseMessageResp) {
|
||||||
|
String msg = JSONObject.toJSONString(baseMessageResp);
|
||||||
log.info("推到终端:{},SN:{},userId:{},消息内容:{}", baseSession.getSessionType(), baseSession.getSn(), baseSession.getUserId(), msg);
|
log.info("推到终端:{},SN:{},userId:{},消息内容:{}", baseSession.getSessionType(), baseSession.getSn(), baseSession.getUserId(), msg);
|
||||||
if(this instanceof BoxWebSocketHandler){
|
if(this instanceof BoxWebSocketHandler){
|
||||||
BoxMessageResp boxMessageResp = JSONObject.parseObject(msg, BoxMessageResp.class);
|
audioService.getAudioUrl(baseMessageResp.getText()).map(s ->{
|
||||||
audioService.getAudioUrl(boxMessageResp.getText()).map(s ->{
|
|
||||||
log.info("音频地址:{}", s);
|
log.info("音频地址:{}", s);
|
||||||
boxMessageResp.setAudio(s);
|
((BoxMessageResp)baseMessageResp).setAudio(s);
|
||||||
baseSession.getSink().next(baseSession.getSession().textMessage(JSONObject.toJSONString(boxMessageResp)));
|
baseSession.getSink().next(baseSession.getSession().textMessage(JSONObject.toJSONString(baseMessageResp)));
|
||||||
return s;
|
return s;
|
||||||
}).subscribe();
|
}).subscribe();
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user