task_id upon success.task_id until the status is completed, and obtain the result audio URL from output.file_url.Parameter Name | Required | Type | Description |
audio_url | No (mutually exclusive with video_url) | string | Enter the audio URL. http(s) public network URLs or data:audio/...;base64,... format are supported. |
video_url | No (mutually exclusive with audio_url) | string | Enter the video URL to directly process videos with audio tracks. If both audio_url and video_url are passed, video_url takes precedence. |
container | No | string | Output container format. m4a (default) / mp3 / flac / ogg. |
codec | No | string | Output audio codec. aac (default) / mp3 / flac / ac3. |
sample_rate | No | integer | Output sample rate. 44100 (default) / 32000 / 48000. |
curl -X POST 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/tool/audio-denoise' \\-H 'Authorization: Bearer YOUR_API_KEY' \\-H 'Content-Type: application/json' \\-d '{"audio_url": "https://example.mp3","container": "m4a","codec": "aac","sample_rate": 44100}'
Parameter Name | Type | Description |
task_id | string | Unique task identifier, used to poll the query API. |
status | string | Task status. |
request_id | string | Unique request identifier. Include it when troubleshooting issues. |
{"task_id": "1400000001-procedurev2-xxxxxxxx","status": "queued","request_id": "9f1c0b7e-e024-426a-bb00-839553cb58c9"}
status is completed or failed.GET https://tokenhub.tencentmaas.com/v1/wand/tool/audio-denoise/tasks/{task_id}Parameter Name | Required | Type | Description |
task_id | Yes | string | Path parameter. Task ID returned by the submission API, which must be passed in as is. |
curl -X GET 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/tool/audio-denoise/tasks/1400000001-procedurev2-xxxxxxxx' \\-H 'Authorization: Bearer YOUR_API_KEY'
Parameter Name | Type | Description |
task_id | string | Unique task identifier. |
status | string | Task status: queued / in_progress / completed / failed. |
progress | integer | Processing progress, ranging from 0 to 100. |
output | object | Result product, returned only when completed. |
output.file_url | string | URL of the result audio, which can be directly downloaded or played. |
error | object | Failure details, returned only when failed. |
error.code | string | Error code. See "Unified error codes". |
error.message | string | Error description, used for troubleshooting and not recommended for program logic judgment. |
request_id | string | Unique request identifier. Include it when troubleshooting issues. |
{"task_id": "1400000001-procedurev2-xxxxxxxx","status": "completed","progress": 100,"output": {"file_url": "https://example.m4a"},"request_id": "5c93e410-e024-426a-bb00-839553cb58c9"}
{"task_id": "1400000001-procedurev2-xxxxxxxx","status": "failed","progress": 100,"error": {"code": "InternalError","message": "internal error"},"request_id": "5c93e410-e024-426a-bb00-839553cb58c9"}
{"request_id": "9f1c0b7e-e024-426a-bb00-839553cb58c9", "error": {"message": "...", "type": "..."}}
HTTP | type | Meaning |
400 | invalid_request_error | Parameter error: audio_url / video_url is missing or mutually exclusive, the URL is invalid or the media type is unsupported, container / codec / sample_rate has an invalid enum value, JSON decoding failed, task_id has an invalid format, or the task does not exist. Correct the request based on message and retry. |
401 | invalid_api_key | The API Key is missing or invalid. Check the Authorization request header. |
404 | not_found | The request path does not exist. Check the path spelling. |
405 | method_not_allowed | The request method is not allowed. Use POST for submission and GET for query. |
429 | rate_limit_exceeded | QPS rate limiting has been triggered (20 QPS by default for submission and 100 QPS by default for query). Reduce the request frequency and retry. |
429 | quota_exceeded | The quota has been exhausted. Retry later or apply for a quota increase. |
500 | server_error | An internal server error has occurred. You can retry. If the issue persists, submit a ticket with the Request ID for troubleshooting. |
status: failed, and the values of error.code are as follows:Error Code | Meaning |
InvalidParameterValue | Invalid parameter value (for example, incompatible encoding and container, or no available audio track in the source file). Check the input parameters. |
InternalError | An internal server error has occurred. You can retry. If the issue persists, submit a ticket with the Request ID for troubleshooting. |
audio_url; to directly process a video with an audio track, pass video_url. If both are passed, video_url takes precedence.m4a, encoded with aac, and has a sample rate of 44100.Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan