Tomoviee AI - 视频配乐 (Video Soundtrack)
Overview
Generate music tailored to video content.
API: INLINECODE0
Quick Start
Authentication
CODEBLOCK0
Python Client
CODEBLOCK1
API Usage
Basic Example
CODEBLOCK2
Parameters
- -
video (required): Video URL (MP4, <200M) - INLINECODE2 : Optional style guidance
- INLINECODE3 : Audio duration (5-900, default: 20)
Async Workflow
- 1. Create task: Get
task_id from API call - Poll for completion: Use INLINECODE5
- Extract result: Parse returned JSON for output URLs
Status codes:
- - 1 = Queued
- 2 = Processing
- 3 = Success (ready)
- 4 = Failed
- 5 = Cancelled
- 6 = Timeout
Resources
scripts/
- -
tomoviee_video_soundtrack_client.py - API client - INLINECODE7 - Auth token generator
references/
See bundled reference documents for detailed API documentation and examples.
External Resources
- - Developer Portal: https://www.tomoviee.ai/developers.html
- API Documentation: https://www.tomoviee.ai/doc/
- Get API Credentials: Register at developer portal
Tomoviee AI - 视频配乐
概述
根据视频内容生成定制音乐。
API: tmvideoscoring
快速开始
身份认证
bash
python scripts/generateauthtoken.py YOURAPPKEY YOURAPPSECRET
Python客户端
python
from scripts.tomovieevideosoundtrack_client import TomovieeClient
client = TomovieeClient(appkey, appsecret)
API使用
基础示例
python
taskid = client.make_request({
video=https://example.com/my-video.mp4
prompt=现代科技产品音乐,干净利落
})
result = client.polluntilcomplete(task_id)
import json
output = json.loads(result[result])
参数
- - video(必填):视频URL(MP4格式,小于200MB)
- prompt:可选的风格指导
- duration:音频时长(5-900秒,默认值:20)
异步工作流程
- 1. 创建任务:从API调用获取taskid
- 轮询完成状态:使用polluntilcomplete(taskid)
- 提取结果:解析返回的JSON以获取输出URL
状态码:
- - 1 = 排队中
- 2 = 处理中
- 3 = 成功(就绪)
- 4 = 失败
- 5 = 已取消
- 6 = 超时
资源
scripts/
- - tomovieevideosoundtrackclient.py - API客户端
- generateauth_token.py - 身份验证令牌生成器
references/
请参阅附带的参考文档,获取详细的API文档和示例。
外部资源
- - 开发者门户:https://www.tomoviee.ai/developers.html
- API文档:https://www.tomoviee.ai/doc/
- 获取API凭证:在开发者门户注册