去掉语句的头尾标点符号
This commit is contained in:
parent
c6ccf6e6b4
commit
00ce4c3731
@ -217,6 +217,14 @@ public class BaseWebSocketService {
|
||||
//标点符号起始会导致合成的声音第一句话有杂音
|
||||
text = text.substring(1);
|
||||
}
|
||||
if(text.endsWith(",") ||
|
||||
text.endsWith("。") ||
|
||||
text.endsWith(":") ||
|
||||
text.endsWith(";") ||
|
||||
text.endsWith("《") ||
|
||||
text.endsWith(" ")){
|
||||
text = text.substring(0, text.length() - 1);
|
||||
}
|
||||
if(text.length() > ONE_MAX_TEXT){
|
||||
StringBuilder builder = new StringBuilder();
|
||||
sendAudioMessage(baseSession,
|
||||
@ -229,6 +237,7 @@ public class BaseWebSocketService {
|
||||
}else{
|
||||
BoxMessageResp boxMessageResp = new BoxMessageResp();
|
||||
BeanUtils.copyProperties(baseMessageResp, boxMessageResp);
|
||||
boxMessageResp.setText(text);
|
||||
sendAudioMessage(baseSession, boxMessageResp).subscribe();
|
||||
}
|
||||
return;
|
||||
@ -354,4 +363,5 @@ public class BaseWebSocketService {
|
||||
return dv;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user