TTS
透過 CometAPI POST /kling/v1/audio/tts 呼叫 Kling TTS,將文字轉換為語音,支援多語言語音選項,並提供 voice_id not found 錯誤的修正方式。
Documentation Index
Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
Use this file to discover all available pages before exploring further.
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.
主體
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.
回應
Success
The response is of type object.