音频
转换 Runway 语音
使用 Runway API 将录制的对话转换为所选语音。
POST
/
runwayml
/
v1
/
speech_to_speech
curl https://api.cometapi.com/runwayml/v1/speech_to_speech \
--request POST \
--header "Authorization: Bearer $COMETAPI_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "eleven_multilingual_sts_v2",
"media": {
"type": "audio",
"uri": "https://your-audio-host/source-speech.mp3"
},
"voice": {
"type": "runway-preset",
"presetId": "Maya"
}
}'{
"id": "123e4567-e89b-42d3-a456-426614174000"
}{
"code": "<string>",
"message": "<string>",
"data": "<unknown>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}使用
将示例媒体 URL 替换为你的源文件。如果使用视频,
请将
POST /runwayml/v1/speech_to_speech 将录制的对话转换为
预设语音。使用模型 ID eleven_multilingual_sts_v2。
使用 Bearer 身份验证和 JSON 请求正文发送你的 CometAPI API 密钥。
提供对话和语音
| 字段 | 必填值 |
|---|---|
model | eleven_multilingual_sts_v2 |
media.type | audio 表示音频文件,或使用 video 表示包含对话的视频 |
media.uri | 源文件的可访问 HTTPS URL |
voice.type | runway-preset |
voice.presetId | 请求架构中的预设语音,例如 Maya |
media.type 改为 video,并在 media.uri 中提供其视频 URL。
将 removeBackgroundNoise: true 设置为移除生成语音中的背景噪声。
省略此字段以使用模型默认值。
获取结果
保存返回的id,然后使用 获取 Runway 任务
以获取任务状态。当 status 为 SUCCEEDED 时,下载生成的
媒体,其 URL 位于 output 中。如果任务失败,请检查 failure 并
failureCode.请求体
application/json
Request settings for eleven_multilingual_sts_v2.
响应
Task created. Save the returned id to retrieve task status.
最后修改于 2026年9月21日
⌘I
curl https://api.cometapi.com/runwayml/v1/speech_to_speech \
--request POST \
--header "Authorization: Bearer $COMETAPI_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "eleven_multilingual_sts_v2",
"media": {
"type": "audio",
"uri": "https://your-audio-host/source-speech.mp3"
},
"voice": {
"type": "runway-preset",
"presetId": "Maya"
}
}'{
"id": "123e4567-e89b-42d3-a456-426614174000"
}{
"code": "<string>",
"message": "<string>",
"data": "<unknown>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}