|
|
@@ -145,7 +145,7 @@ public class WxCVoiceServiceImpl implements WxCVoiceService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Map<String, Object> voicePreview(Long voiceId, String voiceStyle, String text, Integer speed) { |
|
|
|
public Map<String, Object> voicePreview(Long voiceId, String voiceStyle, String text, Integer speed,Integer pitch) { |
|
|
|
VoiceInfo voiceInfo = voiceMapper.selectById(voiceId); |
|
|
|
if(voiceInfo == null){ |
|
|
|
logger.error("未查询到声音{}"+voiceId); |
|
|
@@ -157,6 +157,8 @@ public class WxCVoiceServiceImpl implements WxCVoiceService { |
|
|
|
param.setVoice_style(StringUtils.isBlank(voiceStyle) ? EnumSpeakType.default_0.getMessage() : voiceStyle); |
|
|
|
param.setGen_txt(text.replaceAll(Constant.text_pause, "[*]")); |
|
|
|
param.setSpeed(speed==null?100:speed); |
|
|
|
param.setPitch(pitch); |
|
|
|
param.setVoice_type(voiceInfo.getVoiceType()); |
|
|
|
AiPreviewResult aiTtsResult = AiTtsHelper.voicePreview(param); |
|
|
|
if(!aiTtsResult.isSuccess()){ |
|
|
|
logger.error("tts 预览失败{}"+aiTtsResult.getMsg()); |
|
|
|