From 64bc80f3b2f26af8d3fccb0964925e8087189261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=94=A6=E5=BC=BA?= <1061669148@qq.com> Date: Wed, 9 Apr 2025 14:43:17 +0800 Subject: [PATCH] feat: update TTS API request example and modify getVoice function parameters fix #12 --- workers/src/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/workers/src/index.js b/workers/src/index.js index d971e0c..ea384f8 100644 --- a/workers/src/index.js +++ b/workers/src/index.js @@ -521,14 +521,14 @@ async function handleRequest(request) {

示例请求:

-curl ${baseUrl}/v1/audio/speech \\ +curl -X POST ${baseUrl}/v1/audio/speech \\ -H "Authorization: Bearer your-secret-api-key" \\ -H "Content-Type: application/json" \\ -d '{ "model": "tts-1", "input": "这是一个语音合成测试", "voice": "alloy" - }' + }' --output output.mp3
@@ -1343,7 +1343,7 @@ async function handleOpenAITTS(request) { 'audio-24khz-48kbitrate-mono-mp3'; // 调用 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; } catch (error) {