From bc73cb5930741d5efe88ca5db7525720e8a67244 Mon Sep 17 00:00:00 2001 From: lrh <1585126058@qq.com> Date: Fri, 30 Jun 2023 16:59:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=9B=E5=BB=BA=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sm/impl/PhotoSpeakVideoServiceImpl.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/suimangService/src/main/java/com/iformall/service/sm/impl/PhotoSpeakVideoServiceImpl.java b/suimangService/src/main/java/com/iformall/service/sm/impl/PhotoSpeakVideoServiceImpl.java index 6b88a14..ddce18a 100644 --- a/suimangService/src/main/java/com/iformall/service/sm/impl/PhotoSpeakVideoServiceImpl.java +++ b/suimangService/src/main/java/com/iformall/service/sm/impl/PhotoSpeakVideoServiceImpl.java @@ -183,23 +183,15 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { AiPhotoSpeakParam param = new AiPhotoSpeakParam(); param.setImg(Base64Util.imageUrlToBase64(photoSpeakVideo.getPersonPhotoUrl())); param.setVoice_id(photoSpeakVideo.getVoiceMouldSm() == null ? "default" : photoSpeakVideo.getVoiceMouldSm()); - String voiceMouldSm = photoSpeakVideo.getVoiceMouldSm(); - Integer speakType = 0; - String voiceType = "default";//默认 Integer sex = 1; + String speakType = null; if (!StringUtils.isBlank(voiceMouldSm)) { JSONObject jsonObject = JSON.parseObject(voiceMouldSm); - speakType = jsonObject.getInteger("speakType"); - Integer personType = jsonObject.getInteger("personType"); + speakType = jsonObject.getString("speakType"); sex = jsonObject.getInteger("sex"); - if(speakType != null && speakType > 0){ - voiceType = EnumSpeakType.getEnum(speakType).getMessage(); - }else if(personType != null && personType > 0){ - voiceType = EnumPersonType.getEnum(personType).getMessage(); - } } - param.setVoice_style(EnumSpeakType.getEnum(speakType).getType()); + param.setVoice_style(speakType == null ? "default" : EnumSpeakType.getEnum(speakType).getType()); Integer voiceFrom = photoSpeakVideo.getVoiceFrom(); String voiceMaterialUrl = photoSpeakVideo.getVoiceMaterialUrl();