| @@ -181,8 +181,13 @@ public class AiVideoHelper { | |||||
| JSONObject jsonObject = JSON.parseObject(response); | JSONObject jsonObject = JSON.parseObject(response); | ||||
| JSONObject status = jsonObject.getJSONObject("status"); | JSONObject status = jsonObject.getJSONObject("status"); | ||||
| JSONObject data = jsonObject.getJSONObject("data"); | JSONObject data = jsonObject.getJSONObject("data"); | ||||
| String strURL = data.getString("url"); | |||||
| String time = data.getString("time"); | |||||
| String strURL = null; | |||||
| String time = null; | |||||
| if (data != null){ | |||||
| strURL = data.getString("url"); | |||||
| time = data.getString("time"); | |||||
| } | |||||
| Integer code = status.getInteger("code"); | Integer code = status.getInteger("code"); | ||||
| String msg = status.getString("msg"); | String msg = status.getString("msg"); | ||||
| if (code == null) { | if (code == null) { | ||||
| @@ -245,9 +250,9 @@ public class AiVideoHelper { | |||||
| // | // | ||||
| AiPreviewParam param = new AiPreviewParam(); | AiPreviewParam param = new AiPreviewParam(); | ||||
| param.setGen_txt("今天是个好日子"); | param.setGen_txt("今天是个好日子"); | ||||
| param.setVoice_id("zh-CN-YunyangNeural"); | |||||
| param.setVoice_id("ar-DZ-AminaNeural"); | |||||
| param.setVoice_style("default"); | param.setVoice_style("default"); | ||||
| param.setGender("male"); | |||||
| param.setGender("female"); | |||||
| AiPreviewResult result = AiVideoHelper.voicePreview(param); | AiPreviewResult result = AiVideoHelper.voicePreview(param); | ||||
| System.out.println(result); | System.out.println(result); | ||||
| } | } | ||||