We are pleased to announce the A2E dubbing API with premieum voice and lip-sync quality. Let us go through the API step by step
First, as usual, let’s create an API token (skip this step if you already have an API token) using your login user name and the md5 value of the password
![企业微信截图_ec324b54-a5d6-4647-af3c-86a786015342-1024x817.png](https://www.a2e.ai/wp-content/uploads/2024/09/企业微信截图_ec324b54-a5d6-4647-af3c-86a786015342-1024x817.png)
Provide the login token to get the api token
![企业微信截图_a4d202ed-4515-412a-ae8e-73892ef998a1.png](https://www.a2e.ai/wp-content/uploads/2024/09/企业微信截图_a4d202ed-4515-412a-ae8e-73892ef998a1.png)
In this case, our original mp4 file (https://www.youtube.com/watch?v=glY-Gy8Z2Pk) is downloaded and saved into our S3 bucket.
We use https://video.a2e.ai/api/v1/userDubbing/startDubbing to “start dubbing”
![企业微信截图_f0e2bfa1-9505-4bed-9cbe-fded1b919d5f-1024x907.png](https://www.a2e.ai/wp-content/uploads/2024/09/企业微信截图_f0e2bfa1-9505-4bed-9cbe-fded1b919d5f-1024x907.png)
Remember to set “target_lang” and “source_lang” and “num_speakers”. You will end up with a response showing current_status=”sent”. Keep the “_id” (66ebe3fff47527d543f75b6e in our case) for future queries.
Wait for a while (usually a few minutes), query for its status using “_id”
![企业微信截图_bab7f29f-ccc4-4e48-a8b5-35525e6932ea-1024x889.png](https://www.a2e.ai/wp-content/uploads/2024/09/企业微信截图_bab7f29f-ccc4-4e48-a8b5-35525e6932ea-1024x889.png)
We got “completed”. Keep the result_url which is the translated audio file, for future lip-motion synthesis.
Next, we add this video to our avatar list by https://video.a2e.ai/api/v1/userVideoTwin/startTraining
![企业微信截图_b8bf03ff-4ffa-49ba-bc12-9757e1e4cb4a-1024x848.png](https://www.a2e.ai/wp-content/uploads/2024/09/企业微信截图_b8bf03ff-4ffa-49ba-bc12-9757e1e4cb4a-1024x848.png)
Keep the “_id” in the response for future use. In our case, the “_id” is 66ebecb24cff1fd59cac23bd
Wait for a few minutes, use https://video.a2e.ai/api/v1/userVideoTwin to check the status of the avatar addition:
![企业微信截图_6f06673c-d2a6-42d1-8d59-4e0935cfe39e-1024x690.png](https://www.a2e.ai/wp-content/uploads/2024/09/企业微信截图_6f06673c-d2a6-42d1-8d59-4e0935cfe39e-1024x690.png)
We see it’s completed. The returned “_id” is the same as our query (66ebecb24cff1fd59cac23bd).
![企业微信截图_39e90950-6182-42e0-8da8-f7d168f11043.png](https://www.a2e.ai/wp-content/uploads/2024/09/企业微信截图_39e90950-6182-42e0-8da8-f7d168f11043.png)
Use https://video.a2e.ai/api/v1/anchor/character_list to get the anchor_id. Remember to set “type” as custom.
![企业微信截图_4d55a07c-1181-453e-a56c-b62bae15122d-1024x889.png](https://www.a2e.ai/wp-content/uploads/2024/09/企业微信截图_4d55a07c-1181-453e-a56c-b62bae15122d-1024x889.png)
We get anchor_id as 66ebecd7af6999f007c827a1. Use https://video.a2e.ai/api/v1/video/generate to create a video with AI driven lip-sync that matches the translated audio. Copy 66ebecd7af6999f007c827a1 to anchor_id. Copy the dubbing result mp3 to audioSrc. Set isSkipRs to True because we do not want to change the moton speed of the input video. Do not set back_id because we do not want to change the background.
![企业微信截图_72398841-4483-42d7-9660-0359b8ede00f-1024x780.png](https://www.a2e.ai/wp-content/uploads/2024/09/企业微信截图_72398841-4483-42d7-9660-0359b8ede00f-1024x780.png)
We got “init” as the immediate status. Keep the _id of this video synthesis task:
![企业微信截图_10d30e19-1249-4412-9ba1-20a6797364f7.png](https://www.a2e.ai/wp-content/uploads/2024/09/企业微信截图_10d30e19-1249-4412-9ba1-20a6797364f7.png)
Check the status of this newly submitted video synthesis task using https://video.a2e.ai/api/v1/video/awsResult
![企业微信截图_47241fc2-f286-4fc4-859b-6f061952dcff-1024x829.png](https://www.a2e.ai/wp-content/uploads/2024/09/企业微信截图_47241fc2-f286-4fc4-859b-6f061952dcff-1024x829.png)
While the system is processing, you will read “process” in the “status” field. The processing time is usually 1:5, i.e. it takes 5 minutes to process a 1 minute input video. Wait for a few minutes, until the status turns “success”
![下载-1024x765.webp](https://www.a2e.ai/wp-content/uploads/2024/09/下载-1024x765.webp)
Congratulations! You can download your result video using the “result” URL.
Check it out: