Add default language and rate

This commit is contained in:
Hongbo Wu
2022-11-08 15:41:20 +08:00
parent 3ffd7739bb
commit 769e8c5f96
2 changed files with 8 additions and 6 deletions

View File

@ -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,
})

View File

@ -24,12 +24,12 @@ import { RealisticTextToSpeech } from './realisticTextToSpeech'
type RedisClient = ReturnType<typeof createClient>
interface UtteranceInput {
voice?: string
rate?: string
language?: string
text: string
idx: string
isUltraRealisticVoice?: boolean
voice?: string
rate?: string
language?: string
}
interface HTMLInput {