From 87e8413fa0be51e6975ceb5e0b1ad52295e412f2 Mon Sep 17 00:00:00 2001 From: Neko Ayaka Date: Mon, 2 Dec 2024 21:09:19 +0800 Subject: [PATCH] chore: fix Signed-off-by: Neko Ayaka --- nuxt.config.ts | 2 + package.json | 4 +- server/api/v1/llm/voice/text-to-speech.ts | 52 +++++++++++------------ 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/nuxt.config.ts b/nuxt.config.ts index b6d1fe2..6a1d03d 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -73,6 +73,8 @@ export default defineNuxtConfig({ }, routeRules: { '/assets/**': { static: true }, + '/assets/js/**': { static: true }, + '/assets/live2d/models/**': { static: true }, }, }, diff --git a/package.json b/package.json index a630afc..971aa13 100644 --- a/package.json +++ b/package.json @@ -61,9 +61,7 @@ "vite-plugin-inspect": "^0.10.2", "vue-tsc": "^2.1.10", "yauzl": "^3.2.0", - "zod": "^3.23.8" - }, - "dependencies": { + "zod": "^3.23.8", "elevenlabs": "^0.18.1" } } diff --git a/server/api/v1/llm/voice/text-to-speech.ts b/server/api/v1/llm/voice/text-to-speech.ts index 553ea53..0d1d8f1 100644 --- a/server/api/v1/llm/voice/text-to-speech.ts +++ b/server/api/v1/llm/voice/text-to-speech.ts @@ -1,30 +1,30 @@ -import { ElevenLabsClient } from 'elevenlabs' +// import { ElevenLabsClient } from 'elevenlabs' -export default defineEventHandler(async (event) => { - const body = await readBody<{ text: string, apiKey: string }>(event) - const client = new ElevenLabsClient({ - apiKey: body.apiKey, - }) +// export default defineEventHandler(async (event) => { +// const body = await readBody<{ text: string, apiKey: string }>(event) +// const client = new ElevenLabsClient({ +// apiKey: body.apiKey, +// }) - const res = await client.generate({ - // voice: 'ShanShan', - // Quite good for English - voice: 'Myriam', - // Beatrice is not 'childish' like the others - // voice: 'Beatrice', - text: body.text, - stream: true, - model_id: 'eleven_multilingual_v2', - voice_settings: { - stability: 0.4, - similarity_boost: 0.5, - }, - }) +// const res = await client.generate({ +// // voice: 'ShanShan', +// // Quite good for English +// voice: 'Myriam', +// // Beatrice is not 'childish' like the others +// // voice: 'Beatrice', +// text: body.text, +// stream: true, +// model_id: 'eleven_multilingual_v2', +// voice_settings: { +// stability: 0.4, +// similarity_boost: 0.5, +// }, +// }) - // Set headers for streaming - event.node.res.setHeader('Content-Type', 'audio/mpeg') - event.node.res.setHeader('Transfer-Encoding', 'chunked') +// // Set headers for streaming +// event.node.res.setHeader('Content-Type', 'audio/mpeg') +// event.node.res.setHeader('Transfer-Encoding', 'chunked') - // res is NodeJS.ReadableStream - return sendStream(event, res) -}) +// // res is NodeJS.ReadableStream +// return sendStream(event, res) +// })