<Card> or <ParamField>), or parameter names. These should remain in English.
Structurally, I’m keeping everything identical to the original MDX format, maintaining all markdown syntax, line breaks, and spacing as they are. And, of course, I’m going to leave common technical terms like “API,” “SDK,” and “token” in English - we’re being professional and technical here. My output will be only the translated content.
Let’s start with the frontmatter: “title: “Create Speech"" becomes “title: “创建语音"". “openapi: “POST /v1/audio/speech"" remains untouched. “description: “Generates audio from the input text"" translates to “description: “根据输入文本生成音频"".
Now, onto the headings. ”## Request Body” becomes ”## 请求体”.
The ParamFields section needs attention. “model: TTS model: tts-1 (standard) or tts-1-hd (higher quality).” translates to “TTS 模型:tts-1(标准)或 tts-1-hd(高质量)。” Similarly, “input: The text to generate audio for. Maximum 4096 characters.” becomes “要生成音频的文本。最大长度为 4096 个字符。”, and so on.
The ”## Response” heading translates to ”## 响应”, and “Returns the audio file in the requested format.” becomes “返回所请求格式的音频文件。”
I’ll leave the request example code block as is.
The heading ”## Voice Samples” becomes ”## 音色示例”.
For the table, “Voice” becomes “音色”, and “Description” becomes “描述”. I’ll continue, translating each entry as appropriate.
Finally, I need to double-check my work against the rules. Did I translate tts-1? No, because it’s in backticks. Did I translate model? No, because it’s a parameter name. Excellent. I also made sure to keep “API,” “TTS” in English, and I’ve ensured the MDX structure is perfectly preserved. The translation is complete.
title: “创建语音” openapi: “POST /v1/audio/speech” description: “根据输入文本生成音频”
请求体
TTS 模型:
tts-1(标准)或 tts-1-hd(高质量)。要生成音频的文本。最大长度为 4096 个字符。
使用的音色:
alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer, verse。音频格式:
mp3, opus, aac, flac, wav, pcm。音频语速(0.25 到 4.0)。
响应
返回所请求格式的音频文件。音色示例
| 音色 | 描述 |
|---|---|
alloy | 中性,平衡 |
ash | 冷静,沉稳 |
ballad | 悦耳,富有表现力 |
coral | 温暖,诱人 |
echo | 温暖,谈话式 |
fable | 富有表现力,叙述式 |
nova | 友好,清晰 |
onyx | 深沉,权威 |
sage | 睿智,深思熟虑 |
shimmer | 柔和,温柔 |
verse | 动态,多才多艺 |