Honor the system default speech voice
Build and publish frontend / publish (push) Successful in 43s

This commit is contained in:
Ein Anderssono
2026-10-16 06:31:07 +02:00
parent db76289660
commit bf5ee88610
2 changed files with 12 additions and 5 deletions
+4 -2
View File
@@ -117,17 +117,19 @@ test('recognition watchdog closes a session that never ends and permits retry',
assert.equal(h.recognitions.length, 2);
});
test('TTS selects Swedish fallback, applies rate, and cancellation invalidates callbacks', () => {
test('TTS uses the system default voice unless a named Swedish voice is selected', () => {
const h = makeHarness();
h.controller.update({mode: 'game-voice', rate: 1.4});
assert.equal(h.controller.speak('Hej.'), true);
const first = h.utterances[0];
assert.equal(first.lang, 'sv-SE');
assert.equal(first.rate, 1.4);
assert.equal(first.voice.name, 'Svensk');
assert.equal(first.voice, null);
h.controller.cancelSpeech();
first.onend();
assert.equal(h.controller.getState(), 'IDLE');
assert.equal(h.controller.speak('Namngiven röst.', {voiceName: 'Svensk'}), true);
assert.equal(h.utterances.at(-1).voice.name, 'Svensk');
});
test('a player gesture restores the iOS speech primer after cancelling a queued reply', () => {