fix(audio): longer Piper time for long calls, fallback voice matches the line's language (1.55.2)

This commit is contained in:
larssand committed 2026-11-03 09:16:11 +01:00
1 parent c3aafba327
commit 36fe1e3933
6 files changed
+21 -8

No files matched your search

+3 -2
View File
@@ -8,13 +8,14 @@ import {
speakTextHelper,
} from "../src/runtime_services.js";
test("speech voice selection prefers an explicit voice and then the current language", () => {
test("speech voice selection prefers the chosen voice when it speaks the line's language, else the language", () => {
const voices = [
{ name: "English", lang: "en-US", voiceURI: "voice-en", localService: true },
{ name: "Swedish", lang: "sv-SE", voiceURI: "voice-sv", localService: true },
];
assert.equal(selectSpeechVoice(voices, "voice-en", "sv-SE")?.voiceURI, "voice-en");
assert.equal(selectSpeechVoice(voices, "voice-en", "en-US")?.voiceURI, "voice-en");
assert.equal(selectSpeechVoice(voices, "voice-sv", "en-US")?.voiceURI, "voice-en", "a Swedish voice never reads an English line");
assert.equal(selectSpeechVoice(voices, "", "sv-SE")?.voiceURI, "voice-sv");
assert.equal(selectSpeechVoice(voices, "missing", "de-DE"), null);
});