Browse Source

Tts add voice choose (#2453)

Co-authored-by: luowei <glpat-EjySCyNjWiLqAED-YmwM>
Co-authored-by: crazywoola <427733928@qq.com>
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
Charlie.Wei 1 year ago
parent
commit
c8ca3ff404

+ 6 - 6
api/core/model_runtime/model_providers/openai/tts/tts-1-hd.yaml

@@ -5,22 +5,22 @@ model_properties:
   voices:
     - mode: 'alloy'
       name: 'Alloy'
-      language: ['zh-Hans', 'en-US']
+      language: [ 'zh-Hans', 'en-US', 'de-DE', 'fr-FR', 'es-ES', 'it-IT', 'th-TH', 'id-ID' ]
     - mode: 'echo'
       name: 'Echo'
-      language: ['zh-Hans', 'en-US']
+      language: [ 'zh-Hans', 'en-US', 'de-DE', 'fr-FR', 'es-ES', 'it-IT', 'th-TH', 'id-ID' ]
     - mode: 'fable'
       name: 'Fable'
-      language: ['zh-Hans', 'en-US']
+      language: [ 'zh-Hans', 'en-US', 'de-DE', 'fr-FR', 'es-ES', 'it-IT', 'th-TH', 'id-ID' ]
     - mode: 'onyx'
       name: 'Onyx'
-      language: ['zh-Hans', 'en-US']
+      language: [ 'zh-Hans', 'en-US', 'de-DE', 'fr-FR', 'es-ES', 'it-IT', 'th-TH', 'id-ID' ]
     - mode: 'nova'
       name: 'Nova'
-      language: ['zh-Hans', 'en-US']
+      language: [ 'zh-Hans', 'en-US', 'de-DE', 'fr-FR', 'es-ES', 'it-IT', 'th-TH', 'id-ID' ]
     - mode: 'shimmer'
       name: 'Shimmer'
-      language: ['zh-Hans', 'en-US']
+      language: [ 'zh-Hans', 'en-US', 'de-DE', 'fr-FR', 'es-ES', 'it-IT', 'th-TH', 'id-ID' ]
   word_limit: 120
   audio_type: 'mp3'
   max_workers: 5

+ 6 - 6
api/core/model_runtime/model_providers/openai/tts/tts-1.yaml

@@ -5,22 +5,22 @@ model_properties:
   voices:
     - mode: 'alloy'
       name: 'Alloy'
-      language: ['zh-Hans', 'en-US']
+      language: ['zh-Hans', 'en-US', 'de-DE', 'fr-FR', 'es-ES', 'it-IT', 'th-TH', 'id-ID']
     - mode: 'echo'
       name: 'Echo'
-      language: ['zh-Hans', 'en-US']
+      language: ['zh-Hans', 'en-US', 'de-DE', 'fr-FR', 'es-ES', 'it-IT', 'th-TH', 'id-ID']
     - mode: 'fable'
       name: 'Fable'
-      language: ['zh-Hans', 'en-US']
+      language: ['zh-Hans', 'en-US', 'de-DE', 'fr-FR', 'es-ES', 'it-IT', 'th-TH', 'id-ID']
     - mode: 'onyx'
       name: 'Onyx'
-      language: ['zh-Hans', 'en-US']
+      language: ['zh-Hans', 'en-US', 'de-DE', 'fr-FR', 'es-ES', 'it-IT', 'th-TH', 'id-ID']
     - mode: 'nova'
       name: 'Nova'
-      language: ['zh-Hans', 'en-US']
+      language: ['zh-Hans', 'en-US', 'de-DE', 'fr-FR', 'es-ES', 'it-IT', 'th-TH', 'id-ID']
     - mode: 'shimmer'
       name: 'Shimmer'
-      language: ['zh-Hans', 'en-US']
+      language: ['zh-Hans', 'en-US', 'de-DE', 'fr-FR', 'es-ES', 'it-IT', 'th-TH', 'id-ID']
   word_limit: 120
   audio_type: 'mp3'
   max_workers: 5

+ 1 - 1
web/app/components/app/configuration/config-voice/param-config-content.tsx

@@ -70,7 +70,7 @@ const VoiceParamConfig: FC = () => {
               <div className={'relative h-9'}>
                 <Listbox.Button className={'w-full h-full rounded-lg border-0 bg-gray-100 py-1.5 pl-3 pr-10 sm:text-sm sm:leading-6 focus-visible:outline-none focus-visible:bg-gray-200 group-hover:bg-gray-200 cursor-pointer'}>
                   <span className={classNames('block truncate text-left', !languageItem?.name && 'text-gray-400')}>
-                    {t(`common.voice.language.${languageItem?.value.replace('-', '')}`) ?? localLanguagePlaceholder}
+                    {languageItem?.name ? t(`common.voice.language.${languageItem?.value.replace('-', '')}`) : localLanguagePlaceholder}
                   </span>
                   <span className="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2">
                     <ChevronDownIcon

+ 16 - 0
web/i18n/lang/app-debug.pt.ts

@@ -71,6 +71,11 @@ const translation = {
       description: 'Uma vez ativado, você pode usar entrada de voz.',
       resDes: 'Entrada de voz está ativada',
     },
+    textToSpeech: {
+      title: 'Texto para voz',
+      description: 'Quando ativado, o texto pode ser convertido em fala.',
+      resDes: 'Texto para áudio ativado',
+    },
     citation: {
       title: 'Citações e Atribuições',
       description: 'Uma vez ativado, mostra o documento de origem e a seção atribuída do conteúdo gerado.',
@@ -293,6 +298,17 @@ const translation = {
       uploadLimit: 'Limite de Upload',
     },
   },
+  voice: {
+    name: 'voz',
+    description: 'Texto para configurações de timbre de voz',
+    settings: 'As configurações',
+    voiceSettings: {
+      title: 'voz As configurações',
+      language: 'línguas',
+      resolutionTooltip: 'Texto para voz timbre suporta idiomas.',
+      voice: 'voz',
+    },
+  },
   openingStatement: {
     title: 'Abertura da Conversa',
     add: 'Adicionar',

+ 12 - 0
web/i18n/lang/common.pt.ts

@@ -12,6 +12,18 @@ const translation = {
     displayLanguage: 'Idioma de exibição',
     timezone: 'Fuso horário',
   },
+  voice: {
+    language: {
+      zhHans: 'chinês',
+      enUS: 'inglês',
+      deDE: 'alemão',
+      frFR: 'francês',
+      esES: 'espanhol',
+      itIT: 'italiano',
+      thTH: 'tailandês',
+      idID: 'indonésio',
+    },
+  },
   provider: {
     apiKey: 'Chave da API',
     enterYourKey: 'Insira sua chave da API aqui',