feat: update TTS API request example and modify getVoice function parameters fix #12

This commit is contained in:
王锦强
2025-04-09 14:43:17 +08:00
parent 87ddd3667c
commit 64bc80f3b2

View File

@@ -521,14 +521,14 @@ async function handleRequest(request) {
<div class="mt-2 bg-gray-50 p-2 rounded"> <div class="mt-2 bg-gray-50 p-2 rounded">
<p class="text-xs text-gray-600 mb-1">示例请求:</p> <p class="text-xs text-gray-600 mb-1">示例请求:</p>
<code class="text-xs block overflow-auto whitespace-pre-wrap"> <code class="text-xs block overflow-auto whitespace-pre-wrap">
curl ${baseUrl}/v1/audio/speech \\ curl -X POST ${baseUrl}/v1/audio/speech \\
-H "Authorization: Bearer your-secret-api-key" \\ -H "Authorization: Bearer your-secret-api-key" \\
-H "Content-Type: application/json" \\ -H "Content-Type: application/json" \\
-d '{ -d '{
"model": "tts-1", "model": "tts-1",
"input": "这是一个语音合成测试", "input": "这是一个语音合成测试",
"voice": "alloy" "voice": "alloy"
}' }' --output output.mp3
</code> </code>
</div> </div>
@@ -1343,7 +1343,7 @@ async function handleOpenAITTS(request) {
'audio-24khz-48kbitrate-mono-mp3'; 'audio-24khz-48kbitrate-mono-mp3';
// 调用 TTS API // 调用 TTS API
const ttsResponse = await getVoice(text, voiceName, rate, 0, outputFormat, false); const ttsResponse = await getVoice(text, voiceName, rate, 0,requestData.model ,outputFormat, false);
return ttsResponse; return ttsResponse;
} catch (error) { } catch (error) {