Timing to Audio
Generate a controllable sound effect clip based on input text prompts. (BGM not supported.)
Creators can freely control the timing of multiple sound events within the audio through a timeline.
POST https://api.vidu.com/ent/v2/timing2audio
Request Headers
Field | Value | Description |
---|---|---|
Content-Type | application/json | Data format |
Authorization | Token {your api key} | Replace {your_api_key} with your actual API Key |
Request Body
Field | Type | Required | Description |
---|---|---|---|
model | String | Required | Model Available value: audio1.0 |
duration | Float | Optional | Audio duration. Default: 10 seconds. Range: 2–10 seconds. |
timing_prompts | Array [object] | Required | Timeline-based sound event prompts. Each item defines a sound event with a from and to timestamp and a prompt. - Max 1500 characters per event - Events can overlap - from and to must be within [0, duration] |
seed | Int | Optional | Random seed. If not provided or set to 0, a random value will be used. Fixed value ensures reproducibility. |
callback_url | String | Optional | Callback When creating a task, you need to actively set the callback_url with a POST request. When the video generation task changes its status, Vidu will send a callback request to this URL, containing the latest status of the task. The structure of the callback request content will be the same as the return body of the GET Generation API. The “status” in the callback response includes the following states: - processing: Task is being processed. - success: Task is completed (if sending fails, it will retry the callback three times). - failed: Task failed (if sending fails, it will retry the callback |
curl -X POST -H "Authorization: Token {your_api_key}" -H "Content-Type: application/json" -d ''{"model": "audio1.0","duration": 10,"timing_prompts": [{"from": 0.0,"to": 3.0,"prompt": "Birds chirping in the morning"},{"from": 3.0,"to": 6.0,"prompt": "A distant train passing by"},{"from": 5.0,"to": 9.5,"prompt": "Waves gently lapping the beach"}],"seed": 0}' https://api.vidu.com/ent/v2/timing2audio
Response Body
Field | Type | Description |
---|---|---|
task_id | String | Vidu generated Task ID |
state | String | Task state:: -created -queueing -processing -success -failed |
model | String | Model parameter used |
duration | Int | Audio duration |
timing_prompts | Array | List of configured sound events |
seed | Int | Random seed used |
created_at | String | Task creation timestamp (ISO8601 format) |
{"task_id": "your_task_id_here","state": "created","model": "audio1.0","duration": 10,"timing_prompts": [{"from": 0.0,"to": 3.0,"prompt": "Birds chirping in the morning"},{"from": 3.0,"to": 6.0,"prompt": "A distant train passing by"},{"from": 5.0,"to": 9.5,"prompt": "Waves gently lapping the beach"}],"seed": 0,"created_at": "2025-01-01T10:00:00.000Z"}