tencent cloud

APIs

TextToSpeechSync

다운로드
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-09-18 16:50:58

1. API Description

Domain name for API request: vod.intl.tencentcloudapi.com.

This API is used to initiate a text to speech task.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: TextToSpeechSync.
Version Yes String Common Params. The value used for this API: 2018-07-17.
Region No String Common Params. This parameter is not required.
Text Yes String

Text for the synthesis. This is required for text to speech. The text cannot exceed 2000 bytes in length.

VoiceId Yes String

Voice type Id. Fill in when synthesizing with a specified timbre. Supports system voice types and designed or cloned voice types.

SubAppId No String

VOD application ID. For customers who activate on-demand services after December 25, 2023, this field must be set to the application ID when accessing resources in on-demand applications, whether in the default application or a newly created application.

LanguageBoost No String

Language enhancement, such as "zh" "en" "auto", default "auto"

Output No TextToSpeechSyncOutputOption

Output parameters.

Specifies the output format, etc. The default output is an audio URL.

ExtParam No String

Expansion parameters for synchronous text to speech. Fields supported by ExtParam:

  • model (string): Synthesis model. Options: minimax-speech-2.8-hd, minimax-speech-2.8-turbo, minimax-speech-2.6-hd, minimax-speech-2.6-turbo, minimax-speech-02-hd, minimax-speech-02-turbo. Default: minimax-speech-2.8-hd.
  • voice_setting (object): Voice fine adjustment. Optional fields:
    • speed (float): Speaking rate, [0.5, 2.0]. Default: 1.0.
    • vol (float): Volume, (0, 10]. Default: 1.0.
    • pitch (int): Pitch, [-12, 12]. Default: 0.
    • emotion (string): Emotion. Options: happy / sad / angry / fearful / disgusted / surprised / calm / fluent / whisper.
  • audio_setting (object): Audio output parameter. Optional fields:
    • sample_rate (int): Sampling rate. Options: 8000 / 16000 / 22050 / 24000 / 32000 / 44100. Default: 16000.
    • format (string): Audio format. Options: mp3 / wav. Default: wav.
    • duration (float): Target duration (seconds).
    • cut_silence (bool): Whether to trim silence segments.

3. Output Parameters

Parameter Name Type Description
AudioData String

base64-encoded synthetic audio in wav format.

AudioUrl String

Synthetic audio URL. It is valid for 24 hours.

ExtInfo String

Extended information in the format of a JSON string.

duration: Duration of the resulting audio, in seconds.

RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Synchronize text to speech

Synchronize text to speech

Input Example

POST / HTTP/1.1
Host: vod.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: TextToSpeechSync
<Common request parameters>

{
"Text": "The seed stays silent in the soil, waiting for the thunder when it breaks through."
    "VoiceId": "minimax_5*********527-4dff",
    "LanguageBoost": "zh",
    "ExtParam": "{\"model\": \"minimax-speech-2.8-hd\", \"voice_setting\": {\"speed\": 2.0, \"vol\": 2.0}, \"audio_setting\": {\"sample_rate\": 32000, \"bitrate\": 128000, \"format\": \"mp3\"}}",
    "SubAppId": "221***"
}

Output Example

{
    "Response": {
        "AudioData": "",
        "AudioUrl": "https://laurie-tmp-1300828900.cos.a***********************************b70-c745-4335-bbfc-b2f6c00ac0b2.mp3",
        "ExtInfo": "{\"audio_format\":\"mp3\",\"audio_length\":1836,\"audio_sample_rate\":32000,\"audio_size\":0,\"word_count\":16}",
        "RequestId": "a24cdb70-c745-4335-bbfc-b2f6c00ac0b2"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

There is no error code related to the API business logic. For other error codes, please see Common Error Codes.

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백