For model details and recommendations, see Speech synthesis.
Description: Starts a speech synthesis task and sends the text to synthesize in a single request.
When to send: Send this event immediately after establishing the WebSocket connection.
Response event: The server returns a task-started event.
run-task
Description: Starts a speech synthesis task and sends the text to synthesize in a single request.
When to send: Send this event immediately after establishing the WebSocket connection.
Response event: The server returns a task-started event.
headerobject(required)
Attributes action string(required)The event type. Must be run-task.task_idstring(required)A client-generated task ID in UUID format, used to correlate subsequent events.streamingstring(required)Must be out.object(required)
Attributes task_group string(required)The task group. Must be audio.taskstring(required)The task type. Must be tts.functionstring(required)The function type. Must be SpeechSynthesizer.modelstring(required)The model name, such as sambert-zhichu-v1.inputobject(required)The input data. Contains a text field for the text to synthesize.textstring(required)The text to synthesize.parametersobject(required)Speech synthesis parameters.
Attributes text_type string(required)Must be PlainText.formatstring(optional)The audio format.Valid values:
integer(optional)The audio sample rate, in Hz.Valid values: 8000, 16000 (default), 22050, and 24000.volumeinteger(optional)The volume level.Default value: 50.Valid values: 0 to 100.ratefloat(optional)The speech rate.Default value: 1.0.Valid values: 0.5 to 2.0.pitchfloat(optional)The pitch level.Default value: 1.0.Valid values: 0.5 to 2.0.word_timestamp_enabledboolean(optional)Specifies whether to enable word-level timestamps.Default value: false.Applies to all Sambert models.phoneme_timestamp_enabledboolean(optional)Specifies whether to enable phoneme-level timestamps.Default value: false.word_timestamp_enabled must be true before you enable this parameter. |