Kling
建立 Kling 語音
透過 CometAPI POST /kling/v1/audio/tts 呼叫 Kling TTS,使用多語言聲音將文字轉換為語音,並提供 voice_id not found 錯誤的修正方式。
POST
cURL
TTS
Kling TTS(文字轉語音)API 提供高品質的文字轉語音服務,支援多種語言與聲音選項。參考文件
- API 參考:Kling TTS API 文件
- Voice ID 清單:可用的 Voice ID 參考
常見問題
Voice id not found 錯誤
問題描述:當voice_id 與 voice_language 不相符時,API 會回傳以下錯誤:
voice_id 支援你指定的 voice_language。請參考 Voice ID 清單 來確認每個 voice ID 支援哪些語言。授權
Bearer token authentication. Use your CometAPI key.
標頭
Content type of the request body.
主體
application/json
Text to synthesize into speech. Max 1000 characters.
Voice preset ID. Determines the speaker voice used for synthesis. See the Kling documentation for available voice IDs and their supported languages.
Language of the selected voice. Must match the language supported by the chosen voice_id. Values: zh (Chinese) or en (English).
Speech rate multiplier. Range 0.8–2.0 (one decimal place). Values outside this range are clamped automatically.