Media
为有声书章节添加 ACX 要求的开头/结尾静音和章节间环境音。
用三种语言从你的代码中调用此工具。
# 1) Request a presigned URL → returns { uploadUrl, storageKey }
curl -X POST 'https://api.elysiatools.com/api/upload/presign/audio-audiobook-room-tone-inserter' \
-H 'Content-Type: application/json' \
-d '{"filename":"chapter1.ext","contentType":"application/octet-stream","size":12345}'
curl -X POST 'https://api.elysiatools.com/api/upload/presign/audio-audiobook-room-tone-inserter' \
-H 'Content-Type: application/json' \
-d '{"filename":"chapter2.ext","contentType":"application/octet-stream","size":12345}'
curl -X POST 'https://api.elysiatools.com/api/upload/presign/audio-audiobook-room-tone-inserter' \
-H 'Content-Type: application/json' \
-d '{"filename":"chapter3.ext","contentType":"application/octet-stream","size":12345}'
curl -X POST 'https://api.elysiatools.com/api/upload/presign/audio-audiobook-room-tone-inserter' \
-H 'Content-Type: application/json' \
-d '{"filename":"roomToneSample.ext","contentType":"application/octet-stream","size":12345}'
# 2) PUT the file bytes directly to the presigned uploadUrl
curl -X PUT '<presigned uploadUrl>' \
--data-binary @/path/to/file.ext
# 3) Call the tool, passing the returned storageKey for each file field
curl -X POST 'https://api.elysiatools.com/zh/api/tools/audio-audiobook-room-tone-inserter' \
-F 'chapter1=uploads/2026/01/01/your-tool-1700000000000-abc123.ext' \
-F 'chapter2=uploads/2026/01/01/your-tool-1700000000000-abc123.ext' \
-F 'chapter3=uploads/2026/01/01/your-tool-1700000000000-abc123.ext' \
-F 'toneSource=synthetic' \
-F 'roomToneSample=uploads/2026/01/01/your-tool-1700000000000-abc123.ext' \
-F 'leadInSilence=0.5' \
-F 'leadOutSilence=0.5' \
-F 'roomToneBetween=0.5' \
-F 'outputFormat=wav'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST https://api.elysiatools.com/zh/api/tools/audio-audiobook-room-tone-inserter| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| chapter1 | file需先上传 | 是 | — |
| chapter2 | file需先上传 | 否 | — |
| chapter3 | file需先上传 | 否 | — |
| toneSource | select | 是 | — |
| roomToneSample | file需先上传 | 否 | — |
| leadInSilence | number | 否 | — |
| leadOutSilence | number | 否 | — |
| roomToneBetween | number | 否 | — |
| outputFormat | select | 否 | — |
文件结果
{
"filePath": "/public/processing/randomid.ext",
"fileName": "output.ext",
"contentType": "application/octet-stream",
"size": 1024,
"metadata": {
"key": "value"
},
"error": "Error message (optional)",
"message": "Notification message (optional)"
}将此工具加入你的 Model Context Protocol 服务,让 AI 智能体可以列出并调用它。
将以下内容加入你的 MCP 客户端配置:
{
"mcpServers": {
"elysiatools-audio-audiobook-room-tone-inserter": {
"name": "audio-audiobook-room-tone-inserter",
"description": "为有声书章节添加 ACX 要求的开头/结尾静音和章节间环境音。",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=audio-audiobook-room-tone-inserter",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}连接到 SSE 端点后,列出已开放的工具:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}通过工具 id 调用,参数由其参数表构建:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "audio-audiobook-room-tone-inserter",
"arguments": {
"chapter1": "https://example.com/file.ext",
"chapter2": "https://example.com/file.ext",
"chapter3": "https://example.com/file.ext",
"toneSource": "synthetic",
"roomToneSample": "https://example.com/file.ext",
"leadInSilence": 0.5,
"leadOutSilence": 0.5,
"roomToneBetween": 0.5,
"outputFormat": "wav"
}
}
}有问题或反馈?请联系 [email protected]