|
|
@@ -18,6 +18,7 @@ import com.iformall.utils.HttpUtil; |
|
|
|
import com.iformall.utils.sign.SignUtils; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
|
|
|
|
import java.nio.charset.StandardCharsets; |
|
|
|
import java.security.MessageDigest; |
|
|
@@ -31,12 +32,18 @@ public class AiVideoHelper { |
|
|
|
// http://nas.pucao.cn:2001/gen_dh_video |
|
|
|
public static String uri = "http://nas.pucao.cn:2001"; |
|
|
|
|
|
|
|
public static String url = "http://nas.pucao.cn:2002"; |
|
|
|
// public static String url = "http://nas.pucao.cn:2002"; |
|
|
|
// public static String hy_url = "http://nas.pucao.cn:2002"; |
|
|
|
|
|
|
|
// public static String url = "http://111.198.0.15:22299"; |
|
|
|
public static String url = "http://111.198.0.15:22299"; |
|
|
|
public static String hy_url = "http://111.198.0.15:22288"; |
|
|
|
|
|
|
|
// @Value("${photo.url}") |
|
|
|
// private static String url; |
|
|
|
// @Value("${photo.hy_url}") |
|
|
|
// private static String hy_url; |
|
|
|
// @Value("${photo.talk}") |
|
|
|
// private static String talk_url; |
|
|
|
public static String photo_speak_suffix = "/img_talking"; |
|
|
|
public static String image_quality_suffix = "/image_qualit"; |
|
|
|
public static String voice_preview = "/tts_wav"; |
|
|
@@ -294,14 +301,16 @@ public class AiVideoHelper { |
|
|
|
// param.setUrl("None"); |
|
|
|
// AiPhotoSpeakResult video = AiVideoHelper.createPhotoSpeakVideo(param); |
|
|
|
|
|
|
|
// AiPhotoSpeakParam param = new AiPhotoSpeakParam(); |
|
|
|
// param.setGen_txt("None"); |
|
|
|
// param.setImg(Base64Util.imageUrlToBase64("https://suimang.oss-accelerate.aliyuncs.com/builtin/personphoto/seed50258.png")); |
|
|
|
// param.setGender("None"); |
|
|
|
// param.setVoice_id("default"); |
|
|
|
// param.setVoice_style("default"); |
|
|
|
// param.setUrl("https://video.metavatar.cc/sv/43a5c16d-189251d6a98/43a5c16d-189251d6a98.mp3"); |
|
|
|
// AiPhotoSpeakResult video = AiVideoHelper.createPhotoSpeakVideo(param); |
|
|
|
AiPhotoSpeakParam param = new AiPhotoSpeakParam(); |
|
|
|
param.setCallback_url("https://phototest.metavatar.cc/C/callback/photo/speak"); |
|
|
|
param.setTask_id(836805079248850944L); |
|
|
|
param.setGen_txt("None"); |
|
|
|
param.setImg(Base64Util.imageUrlToBase64("https://suimang.oss-accelerate.aliyuncs.com/capi/2023-06-07/6da595fe12ef405bb6434f31e6bad4ec.png")); |
|
|
|
param.setGender("None"); |
|
|
|
param.setVoice_id("default"); |
|
|
|
param.setVoice_style("default"); |
|
|
|
param.setUrl("https://video.metavatar.cc/sv/262b03bd-18929af12fd/262b03bd-18929af12fd.mp3"); |
|
|
|
AiPhotoSpeakResult video = AiVideoHelper.createPhotoSpeakVideo(param); |
|
|
|
|
|
|
|
// AiCheckPhotoParam param = new AiCheckPhotoParam(); |
|
|
|
// String img = Base64Util.imageUrlToBase64("https://suimang.oss-accelerate.aliyuncs.com/builtin/personmould/16760216806604820_cSHoijDX_grace_1080.jpg"); |
|
|
@@ -309,16 +318,17 @@ public class AiVideoHelper { |
|
|
|
// AiCheckPhotoResult result = AiVideoHelper.checkPhoto(param); |
|
|
|
// System.out.println(result); |
|
|
|
// |
|
|
|
AiPreviewParam param = new AiPreviewParam(); |
|
|
|
param.setGen_txt("今天是个好日子"); |
|
|
|
param.setVoice_id("ar-DZ-AminaNeural"); |
|
|
|
param.setVoice_style("default"); |
|
|
|
param.setGender("female"); |
|
|
|
AiPreviewResult result = AiVideoHelper.voicePreview(param); |
|
|
|
System.out.println(result); |
|
|
|
// AiPreviewParam param = new AiPreviewParam(); |
|
|
|
// param.setGen_txt("今天是个好日子"); |
|
|
|
// param.setVoice_id("ar-DZ-AminaNeural"); |
|
|
|
// param.setVoice_style("default"); |
|
|
|
// param.setGender("female"); |
|
|
|
// AiPreviewResult result = AiVideoHelper.voicePreview(param); |
|
|
|
// System.out.println(result); |
|
|
|
|
|
|
|
// AiVideoHqParam param = new AiVideoHqParam(); |
|
|
|
// param.setSave_dir(); |
|
|
|
// param.setSave_dir("static/video/2023-07-06/16886220017209544_wav.mp4"); |
|
|
|
// param.setAudio_path("static/mp3/2023-07-06/291ab7dc-18929b6e89e_convert.wav"); |
|
|
|
// AiVideoHqResult result = AiVideoHelper.videoHq(param); |
|
|
|
// System.out.println(result); |
|
|
|
} |
|
|
|