Scenarios
This document provides end-to-end operation guidelines for 2D real-person avatar and Customized Text To Speech (CTTS).
Prerequisites
Official Environment Primary Domain Name: https://gw-sg.tvs.qq.com
Custom Avatar
Step One: Obtain a Temporary Token and Upload the Material File to Tencent Cloud Storage Service (COS)
Target:
Upload the material files to the cloud storage service using the temporary token for future reference by the avatar customization service to obtain the material files. The process mainly involves two steps.
Step 1:
Obtain the temporary token and related parameters. Please refer to Obtain the Temporary Upload Token to get the following four key pieces of information: Token, TmpSecretId, TmpSecretKey, and PathPrefix. Then, parse out more parameter information from the obtained PathPrefix in the format PathPrefix=https://{bucket}.cos.{region}.myqcloud.com/{key}. Finally, this step can obtain the following parameters: Token (one of the three elements of the temporary key), TmpSecretId (one of the three elements of the temporary key, SecretId), TmpSecretKey (one of the three elements of the temporary key, SecretKey), Bucket (bucket name), Region (storage service region), and Key (component of the bucket object's domain names or IP addresses). Step 2:
Call the COS_SDK to upload material files to Tencent Cloud Storage Service (COS). Please refer to Uploading Materials to Tencent Cloud COS. Choose the appropriate SDK according to the actual situation. The required parameters in this SDK include: TmpSecretId, TmpSecretKey, TmpToken, region, coskey, and local file address. TmpSecretId: Use the TmpSecretId obtained in the previous step.
TmpSecretKey: Use the TmpSecretKey obtained in the previous step.
TmpToken: Get the token obtained in the previous step.
Region: Use the Region obtained in the previous step.
CosKey: Concatenate the key obtained in the previous step. There are 5 following cases.
Upload video authorization, coskey={key}idcard/xxxx.mp4
Upload written authorization letter, coskey={key}idcard/xxxx.pdf
Upload video footage for custom avatar, coskey={key}video/xxxx.mp4
Upload photo materials for custom avatar, coskey={key}photo/xxxx.png (support jpg/jpeg/png/webp)
Upload audio materials for custom voice, coskey={key}audio/xxxx.zip (for package content and format requirements, see the MaterialCosUrl parameter introduction in custom API). Local address of material file: fill in according to the actual situation just.
Result returned:
After requesting via SDK, you will receive a prompt indicating the material upload succeeded and the corresponding material link. You can click View to check whether the upload was successful.
Step Two: Call the Custom API to Customize Image or Voice
Target:
Through this API, initiate customized service. The program will automatically pull materials from the previous step for customization.
Note:
Purchase the corresponding avatar or voice type customization quota in advance.
For specific calls, please refer to Customization API. The parameter values of IdentityCosUrl, IdentityWrittenCosUrl, and MaterialCosUrl are equal to "/{coskey}" (coskey refers to the parameter in step one). Returned result:
The custom task will return a unique TaskId. Subsequent steps will query the status and download based on this TaskId.
Step 3: Query the Customization Progress of Image or Voice Via the Query API
Target:
Use this API to get the progress and results of the custom task in real time.
The result returned:
Query StageInfo data content based on different status. When customization is complete, you can query the Demo address for effect confirmation. Likewise, you can query sound.
Step Four: Effect Confirmation
Target:
After confirming via the effect confirmation API, the avatar will be assigned to the designated UIN account and used for session interaction or video generation.
Voice replication
On the basis of a custom avatar, a front audio quality inspection work will be added, mainly divided into two scenarios: basic version and ultra-fast version.
Basic Version
Follow up by referring to the custom avatar process to advance.
Ultra-Fast Version
preparations 2: record audio manually.
Refer to the custom avatar process and advance subsequently.