feat(editor): display name for available voices

This commit is contained in:
Valentyne Stigloher 2025-09-15 21:25:30 +02:00
parent 06826fb5ea
commit fe7644a718
3 changed files with 44 additions and 10 deletions

View File

@ -45,8 +45,8 @@ watch(pronounciationModelValue, (value, oldValue) => {
const sortedVoices = computed(() => { const sortedVoices = computed(() => {
const voicesOfLocale = config.pronunciation?.enabled ? config.pronunciation.voices : []; const voicesOfLocale = config.pronunciation?.enabled ? config.pronunciation.voices : [];
return (Object.keys(voices) as VoiceKey[]).toSorted((a, b) => { return entriesWithKeys(voices).toSorted((a, b) => {
return (voicesOfLocale.includes(b) ? 1 : 0) - (voicesOfLocale.includes(a) ? 1 : 0); return (voicesOfLocale.includes(b.key as VoiceKey) ? 1 : 0) - (voicesOfLocale.includes(a.key as VoiceKey) ? 1 : 0);
}); });
}); });
</script> </script>
@ -70,8 +70,8 @@ const sortedVoices = computed(() => {
<option :value="null"> <option :value="null">
<T>profile.pronunciation.voice.without</T> <T>profile.pronunciation.voice.without</T>
</option> </option>
<option v-for="voice of sortedVoices" :key="voice" :value="voice"> <option v-for="voice of sortedVoices" :key="voice.key" :value="voice.key">
{{ voice.toUpperCase() }} {{ voice.key.toUpperCase() }} {{ voice.name }}
</option> </option>
</select> </select>
<PronunciationSpeaker <PronunciationSpeaker

View File

@ -29,7 +29,7 @@ pronouns:
pronunciation: pronunciation:
enabled: false enabled: false
ipa: true ipa: true
voices: ['tok'] voices: ['us']
sources: sources:
enabled: false enabled: false

View File

@ -6,6 +6,10 @@ export type Voice = AwsPollyVoice | NarakeetVoice;
* @see https://docs.aws.amazon.com/polly/latest/dg/voicelist.html * @see https://docs.aws.amazon.com/polly/latest/dg/voicelist.html
*/ */
export interface AwsPollyVoice { export interface AwsPollyVoice {
/**
* human-readable name
*/
name: string;
/** /**
* text-to-speech provider (aws_polly is the default, if not specified) * text-to-speech provider (aws_polly is the default, if not specified)
*/ */
@ -25,6 +29,10 @@ export interface AwsPollyVoice {
} }
export interface NarakeetVoice { export interface NarakeetVoice {
/**
* human-readable name
*/
name: string;
/** /**
* text-to-speech provider * text-to-speech provider
*/ */
@ -43,131 +51,157 @@ const defineVoices = <T extends Record<string, Voice>>(voices: T) => voices as R
export const voices = defineVoices({ export const voices = defineVoices({
ar: { ar: {
name: 'العربية',
language: 'arb', language: 'arb',
voice: 'Zeina', voice: 'Zeina',
engine: 'standard', engine: 'standard',
}, },
ae: { ae: {
name: '(الخليجية) العربية',
language: 'ar-AE', language: 'ar-AE',
voice: 'Hala', voice: 'Hala',
engine: 'neural', engine: 'neural',
}, },
de: { de: {
name: 'Deutsch',
language: 'de-DE', language: 'de-DE',
voice: 'Vicki', voice: 'Vicki',
engine: 'standard', engine: 'standard',
}, },
gb: { gb: {
name: 'English (British)',
language: 'en-GB', language: 'en-GB',
voice: 'Emma', voice: 'Emma',
engine: 'neural', engine: 'neural',
}, },
us: {
name: 'English (American)',
language: 'es-US',
voice: 'Lupe',
engine: 'standard',
},
es: { es: {
name: 'Español (España)',
language: 'es-ES', language: 'es-ES',
voice: 'Lucia', voice: 'Lucia',
engine: 'standard', engine: 'standard',
}, },
mx: { mx: {
name: 'Español (México)',
language: 'es-MX', language: 'es-MX',
voice: 'Mia', voice: 'Mia',
engine: 'standard', engine: 'standard',
}, },
fi: { fi: {
name: 'Suomi',
language: 'fi-FI', language: 'fi-FI',
voice: 'Suvi', voice: 'Suvi',
engine: 'neural', engine: 'neural',
}, },
fr: { fr: {
name: 'Français (France)',
language: 'fr-FR', language: 'fr-FR',
voice: 'Lea', voice: 'Lea',
engine: 'standard', engine: 'standard',
}, },
ca: { ca: {
name: 'Français (Canada)',
language: 'fr-CA', language: 'fr-CA',
voice: 'Gabrielle', voice: 'Gabrielle',
engine: 'neural', engine: 'neural',
}, },
bos: { bos: {
name: 'Босански',
language: 'bos', language: 'bos',
voice: 'suada', voice: 'suada',
provider: 'narakeet', provider: 'narakeet',
}, },
hrv: { hrv: {
name: 'Hrvatski',
language: 'hrv', language: 'hrv',
voice: 'jasna', voice: 'jasna',
provider: 'narakeet', provider: 'narakeet',
}, },
srp: { srp: {
name: 'Српски',
language: 'srp', language: 'srp',
voice: 'milica-latin', voice: 'milica-latin',
provider: 'narakeet', provider: 'narakeet',
}, },
it: { it: {
name: 'Italiano',
language: 'it-IT', language: 'it-IT',
voice: 'Bianca', voice: 'Bianca',
engine: 'neural', engine: 'neural',
}, },
ja: { ja: {
name: '日本語',
language: 'ja-JP', language: 'ja-JP',
voice: 'Mizuki', voice: 'Mizuki',
engine: 'standard', engine: 'standard',
}, },
ko: { ko: {
name: '한국어',
language: 'ko-KR', language: 'ko-KR',
voice: 'Seoyeon', voice: 'Seoyeon',
engine: 'neural', engine: 'neural',
}, },
nb: { nb: {
name: 'Norsk',
language: 'nb-NO', language: 'nb-NO',
voice: 'Liv', voice: 'Liv',
engine: 'standard', engine: 'standard',
}, },
nl: { nl: {
name: 'Nederlands',
language: 'nl-NL', language: 'nl-NL',
voice: 'Ruben', voice: 'Ruben',
engine: 'standard', engine: 'standard',
}, },
pl: { pl: {
name: 'Polski',
language: 'pl-PL', language: 'pl-PL',
voice: 'Ewa', voice: 'Ewa',
engine: 'standard', engine: 'standard',
}, },
pt: { pt: {
name: 'Português (europeu)',
language: 'pt-PT', language: 'pt-PT',
voice: 'Cristiano', voice: 'Cristiano',
engine: 'standard', engine: 'standard',
}, },
br: { br: {
name: 'Português (brasileiro)',
language: 'pt-BR', language: 'pt-BR',
voice: 'Vitoria', voice: 'Vitoria',
engine: 'standard', engine: 'standard',
}, },
ro: { ro: {
name: 'Română',
language: 'ro-RO', language: 'ro-RO',
voice: 'Carmen', voice: 'Carmen',
engine: 'standard', engine: 'standard',
}, },
ru: { ru: {
name: 'Русский',
language: 'ru-RU', language: 'ru-RU',
voice: 'Tatyana', voice: 'Tatyana',
engine: 'standard', engine: 'standard',
}, },
se: { se: {
name: 'Svenska',
language: 'sv-SE', language: 'sv-SE',
voice: 'Astrid', voice: 'Astrid',
engine: 'standard', engine: 'standard',
}, },
tok: {
language: 'es-US',
voice: 'Lupe',
engine: 'standard',
},
tr: { tr: {
name: 'Türkçe',
language: 'tr-TR', language: 'tr-TR',
voice: 'Filiz', voice: 'Filiz',
engine: 'standard', engine: 'standard',
}, },
cn: { cn: {
name: '中文(普通话)',
language: 'cmn-CN', language: 'cmn-CN',
voice: 'Zhiyu', voice: 'Zhiyu',
engine: 'standard', engine: 'standard',