@@ -52,6 +52,9 @@ public class VideoSynthesisParam extends HalfDuplexServiceParam {
5252 /** The input image url, Generate the URL of the image referenced by the video */
5353 @ Builder .Default private String imgUrl = null ;
5454
55+ /** The input audio url. */
56+ @ Builder .Default private String audioUrl = null ;
57+
5558 /** The extra parameters. */
5659 @ GsonExclude @ Singular protected Map <String , Object > extraInputs ;
5760
@@ -77,6 +80,8 @@ public class VideoSynthesisParam extends HalfDuplexServiceParam {
7780
7881 @ Builder .Default private Boolean watermark = null ;
7982
83+ @ Builder .Default private Boolean audio = null ;
84+
8085 /** The inputs of the model. */
8186 @ Override
8287 public JsonObject getInput () {
@@ -99,6 +104,9 @@ public JsonObject getInput() {
99104 if (imgUrl != null && !imgUrl .isEmpty ()) {
100105 jsonObject .addProperty (IMG_URL , imgUrl );
101106 }
107+ if (audioUrl != null && !audioUrl .isEmpty ()) {
108+ jsonObject .addProperty (AUDIO_URL , audioUrl );
109+ }
102110
103111 if (firstFrameUrl != null && !firstFrameUrl .isEmpty ()) {
104112 jsonObject .addProperty (FIRST_FRAME_URL , firstFrameUrl );
@@ -153,6 +161,9 @@ public Map<String, Object> getParameters() {
153161 if (watermark != null ) {
154162 params .put (WATERMARK , watermark );
155163 }
164+ if (audio != null ) {
165+ params .put (AUDIO , audio );
166+ }
156167 params .putAll (super .getParameters ());
157168 return params ;
158169 }
@@ -184,6 +195,7 @@ public void validate() throws InputRequiredException {}
184195 public void checkAndUpload () throws NoApiKeyException , UploadFileException {
185196 Map <String , String > inputChecks = new HashMap <>();
186197 inputChecks .put (IMG_URL , this .imgUrl );
198+ inputChecks .put (AUDIO_URL , this .audioUrl );
187199 inputChecks .put (FIRST_FRAME_URL , this .firstFrameUrl );
188200 inputChecks .put (LAST_FRAME_URL , this .lastFrameUrl );
189201 inputChecks .put (HEAD_FRAME , this .headFrame );
@@ -195,6 +207,7 @@ public void checkAndUpload() throws NoApiKeyException, UploadFileException {
195207 this .putHeader ("X-DashScope-OssResourceResolve" , "enable" );
196208
197209 this .imgUrl = inputChecks .get (IMG_URL );
210+ this .audioUrl = inputChecks .get (AUDIO_URL );
198211 this .firstFrameUrl = inputChecks .get (FIRST_FRAME_URL );
199212 this .lastFrameUrl = inputChecks .get (LAST_FRAME_URL );
200213 this .headFrame = inputChecks .get (HEAD_FRAME );
0 commit comments