跳转到内容
本站为社区维护的非官方中文翻译,与 Cloudflare, Inc. 无关联。本站不提供账户登录,请勿在任何非官方站点输入您的 Cloudflare 账户信息。官方文档:developers.cloudflare.com
MiniMax logo

MiniMax Speech 2.8 Turbo

Text-to-Speech • MiniMax

查看 MarkdownAgent 设置
  • Third-party
  • Zero data retention

MiniMax Speech 2.8 Turbo 以更快的速度将文本转换为自然、富有表现力的语音,支持声音克隆、情感控制和 40 多种语言。

模型信息
条款和许可证链接 ↗
更多信息链接 ↗
零数据保留是
定价在 Cloudflare 仪表板中查看定价 ↗

用法

const response = await env.AI.run(
  'minimax/speech-2.8-turbo',
  {
    format: 'mp3',
    pitch: 0,
    speed: 1,
    text: 'Hello! Welcome to Cloudflare AI Gateway. Let me show you what we can do.',
    voice_id: 'English_expressive_narrator',
    volume: 1,
  },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "minimax/speech-2.8-turbo",
  "input": {
    "format": "mp3",
    "pitch": 0,
    "speed": 1,
    "text": "Hello! Welcome to Cloudflare AI Gateway. Let me show you what we can do.",
    "voice_id": "English_expressive_narrator",
    "volume": 1
  }
}'
{
  "gatewayMetadata": {
    "keySource": "Unified"
  },
  "result": {
    "audio": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/minimax__speech-2.8-turbo/simple-speech.mp3"
  },
  "state": "Completed"
}

示例

快速旁白 — 加快旁白语速以便快速播放
const response = await env.AI.run(
  'minimax/speech-2.8-turbo',
  {
    format: 'mp3',
    pitch: 0,
    speed: 1.5,
    text: 'This is a fast-paced summary of the key findings from the quarterly report. Revenue is up fifteen percent and user growth exceeded expectations.',
    voice_id: 'English_expressive_narrator',
    volume: 1,
  },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "minimax/speech-2.8-turbo",
  "input": {
    "format": "mp3",
    "pitch": 0,
    "speed": 1.5,
    "text": "This is a fast-paced summary of the key findings from the quarterly report. Revenue is up fifteen percent and user growth exceeded expectations.",
    "voice_id": "English_expressive_narrator",
    "volume": 1
  }
}'
{
  "gatewayMetadata": {
    "keySource": "Unified"
  },
  "result": {
    "audio": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/minimax__speech-2.8-turbo/fast-narration.mp3"
  },
  "state": "Completed"
}
平静语调 — 适用于冥想或放松的平静、平稳语音
const response = await env.AI.run(
  'minimax/speech-2.8-turbo',
  {
    emotion: 'calm',
    format: 'mp3',
    pitch: 0,
    speed: 0.8,
    text: 'Take a deep breath in. Hold it for a moment. Now slowly exhale. Let your shoulders relax and release any tension.',
    voice_id: 'English_expressive_narrator',
    volume: 1,
  },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "minimax/speech-2.8-turbo",
  "input": {
    "emotion": "calm",
    "format": "mp3",
    "pitch": 0,
    "speed": 0.8,
    "text": "Take a deep breath in. Hold it for a moment. Now slowly exhale. Let your shoulders relax and release any tension.",
    "voice_id": "English_expressive_narrator",
    "volume": 1
  }
}'
{
  "gatewayMetadata": {
    "keySource": "Unified"
  },
  "result": {
    "audio": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/minimax__speech-2.8-turbo/calm-tone.mp3"
  },
  "state": "Completed"
}
调整音高 — 降低音高以获得更低沉的声音
const response = await env.AI.run(
  'minimax/speech-2.8-turbo',
  {
    format: 'mp3',
    pitch: -6,
    speed: 1,
    text: 'Good evening. Tonight we explore the mysteries of the deep ocean and the creatures that live in total darkness.',
    voice_id: 'English_expressive_narrator',
    volume: 1,
  },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "minimax/speech-2.8-turbo",
  "input": {
    "format": "mp3",
    "pitch": -6,
    "speed": 1,
    "text": "Good evening. Tonight we explore the mysteries of the deep ocean and the creatures that live in total darkness.",
    "voice_id": "English_expressive_narrator",
    "volume": 1
  }
}'
{
  "gatewayMetadata": {
    "keySource": "Unified"
  },
  "result": {
    "audio": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/minimax__speech-2.8-turbo/adjusted-pitch.mp3"
  },
  "state": "Completed"
}

参数

text
stringrequiredmaxLength: 10000要转换为语音的文本。最多 10,000 个字符。
voice_id
stringrequireddefault: English_expressive_narrator用于合成的语音 ID
speed
numberrequireddefault: 1minimum: 0.5maximum: 2语速(0.5 至 2)
volume
numberrequireddefault: 1minimum: 0maximum: 10音量(0 至 10)
pitch
integerrequireddefault: 0minimum: -12maximum: 12音高调整(-12 至 12)
emotion
stringenum: happy, sad, angry, fearful, disgusted, surprised, calm, fluent合成语音的情感控制
format
stringrequireddefault: mp3enum: mp3, flac, wav输出音频格式
audio
string生成音频文件的 URL

API schema(原始)

输入
输出

这篇文档对您有帮助吗?