Spaces:
Sleeping
Sleeping
wip
Browse files
src/app/api/voice/route.ts
CHANGED
|
@@ -3,31 +3,31 @@ import { NextResponse } from 'next/server';
|
|
| 3 |
const VOICES = {
|
| 4 |
fr: {
|
| 5 |
LAWYER_VOICE: {
|
| 6 |
-
id: "
|
| 7 |
volume: 0
|
| 8 |
},
|
| 9 |
GLITCH_VOICE: {
|
| 10 |
-
id: "
|
| 11 |
volume: -10
|
| 12 |
}
|
| 13 |
},
|
| 14 |
en: {
|
| 15 |
LAWYER_VOICE: {
|
| 16 |
-
id: "
|
| 17 |
volume: 0
|
| 18 |
},
|
| 19 |
GLITCH_VOICE: {
|
| 20 |
-
id: "
|
| 21 |
volume: -10
|
| 22 |
}
|
| 23 |
},
|
| 24 |
es: {
|
| 25 |
LAWYER_VOICE: {
|
| 26 |
-
id: "
|
| 27 |
volume: 0
|
| 28 |
},
|
| 29 |
GLITCH_VOICE: {
|
| 30 |
-
id: "
|
| 31 |
volume: -10
|
| 32 |
}
|
| 33 |
}
|
|
@@ -56,6 +56,7 @@ export async function POST(request: Request) {
|
|
| 56 |
if (i % 2 === 1) {
|
| 57 |
// Pour les segments glitch, on utilise une voix différente
|
| 58 |
const voiceConfig = VOICES[language as keyof typeof VOICES].GLITCH_VOICE;
|
|
|
|
| 59 |
const response = await fetch(
|
| 60 |
`https://api.elevenlabs.io/v1/text-to-speech/${voiceConfig.id}`,
|
| 61 |
{
|
|
|
|
| 3 |
const VOICES = {
|
| 4 |
fr: {
|
| 5 |
LAWYER_VOICE: {
|
| 6 |
+
id: "XgXB0fxFNJAEDoy7QEp5",
|
| 7 |
volume: 0
|
| 8 |
},
|
| 9 |
GLITCH_VOICE: {
|
| 10 |
+
id: "MWhJLNn7P7uvQrOTocc8",
|
| 11 |
volume: -10
|
| 12 |
}
|
| 13 |
},
|
| 14 |
en: {
|
| 15 |
LAWYER_VOICE: {
|
| 16 |
+
id: "fd4ATHXiyini901jkN6M",
|
| 17 |
volume: 0
|
| 18 |
},
|
| 19 |
GLITCH_VOICE: {
|
| 20 |
+
id: "ZCgnAThIoaTqZwEGwRb4",
|
| 21 |
volume: -10
|
| 22 |
}
|
| 23 |
},
|
| 24 |
es: {
|
| 25 |
LAWYER_VOICE: {
|
| 26 |
+
id: "tozjSvFqKBPpgsJFDfS0",
|
| 27 |
volume: 0
|
| 28 |
},
|
| 29 |
GLITCH_VOICE: {
|
| 30 |
+
id: "AnLaVu7KDTirBKuGkCZt",
|
| 31 |
volume: -10
|
| 32 |
}
|
| 33 |
}
|
|
|
|
| 56 |
if (i % 2 === 1) {
|
| 57 |
// Pour les segments glitch, on utilise une voix différente
|
| 58 |
const voiceConfig = VOICES[language as keyof typeof VOICES].GLITCH_VOICE;
|
| 59 |
+
console.log('voiceConfig:', voiceConfig)
|
| 60 |
const response = await fetch(
|
| 61 |
`https://api.elevenlabs.io/v1/text-to-speech/${voiceConfig.id}`,
|
| 62 |
{
|