add custome voice

This commit is contained in:
larssand
2026-08-28 13:47:25 +02:00
parent fa3e5ee379
commit 34e55ff7f6
9 changed files with 31 additions and 7 deletions

View File

@@ -1013,6 +1013,10 @@ const TRANSLATIONS = {
"audio.enabled": "Aktivera nya raceljud",
"audio.mute": "Tysta allt",
"audio.language": "Utropsspråk",
"audio.voice_select": "Race-röst",
"audio.voice_auto": "Automatisk röst för valt språk",
"audio.voice_rate": "Race-röstens hastighet",
"audio.voice_pitch": "Race-röstens tonhöjd",
"audio.start_countdown": "Nedräkning före start",
"audio.master_volume": "Mastervolym",
"audio.effects_volume": "Effektvolym",
@@ -2120,6 +2124,10 @@ const TRANSLATIONS = {
"audio.enabled": "Enable new race audio",
"audio.mute": "Mute all",
"audio.language": "Announcement language",
"audio.voice_select": "Race voice",
"audio.voice_auto": "Automatic voice for selected language",
"audio.voice_rate": "Race voice speed",
"audio.voice_pitch": "Race voice pitch",
"audio.start_countdown": "Pre-start countdown",
"audio.master_volume": "Master volume",
"audio.effects_volume": "Effects volume",
@@ -2744,7 +2752,7 @@ const raceAudioEngine = createRaceAudioEngine({
speak: (text, options = {}) => new Promise((resolve) => {
let settled = false;
const done = (value) => { if (!settled) { settled = true; resolve(value); } };
const started = speakText(text, { ...options, voiceUri: "", onEnd: () => done(true), onError: () => done(false) });
const started = speakText(text, { ...options, voiceUri: state.settings.raceAudio?.voiceUri || "", rate: state.settings.raceAudio?.voiceRate, pitch: state.settings.raceAudio?.voicePitch, onEnd: () => done(true), onError: () => done(false) });
if (!started) done(false);
else setTimeout(() => done(true), 15000);
}),