From 769e8c5f967184ccdd06e6410294704ed93fff49 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Tue, 8 Nov 2022 15:41:20 +0800 Subject: [PATCH] Add default language and rate --- packages/api/src/routers/text_to_speech.ts | 8 +++++--- packages/text-to-speech/src/index.ts | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/api/src/routers/text_to_speech.ts b/packages/api/src/routers/text_to_speech.ts index 2e9d0b39d..cd79ab052 100644 --- a/packages/api/src/routers/text_to_speech.ts +++ b/packages/api/src/routers/text_to_speech.ts @@ -67,8 +67,10 @@ export function textToSpeechRouter() { title: page.title, content: page.content, options: { - primaryVoice: userPersonalization?.speechVoice || 'Larry', - secondaryVoice: 'Evelyn', + primaryVoice: userPersonalization?.speechVoice || 'Axel', + secondaryVoice: userPersonalization?.speechVoice || 'Evelyn', + language: page.language || 'English', + rate: '1.1', }, }) @@ -78,7 +80,7 @@ export function textToSpeechRouter() { userId, speechId: utterance.idx, text: utterance.text, - voice: utterance.voice || 'Larry', + voice: utterance.voice || 'Axel', priority: 'high', isUltraRealisticVoice: true, }) diff --git a/packages/text-to-speech/src/index.ts b/packages/text-to-speech/src/index.ts index 7bdb5f40f..7bd73a448 100644 --- a/packages/text-to-speech/src/index.ts +++ b/packages/text-to-speech/src/index.ts @@ -24,12 +24,12 @@ import { RealisticTextToSpeech } from './realisticTextToSpeech' type RedisClient = ReturnType interface UtteranceInput { - voice?: string - rate?: string - language?: string text: string idx: string isUltraRealisticVoice?: boolean + voice?: string + rate?: string + language?: string } interface HTMLInput {