feat(tts): multi-voice switcher for EN & RU, Irina default voice, punctuation pause normalization and speed calibration

This commit is contained in:
Antigravity committed 2026-10-07 12:07:01 +03:00
1 parent 7893b353aa
commit 31e105b2c2
11 files changed
+486 -61

No files matched your search

+14 -2
View File
@@ -185,8 +185,12 @@ export const api = {
// Listening Comprehension Trainer
listening: {
async getExercise(topic = 'all', level = 'B1') {
const resp = await fetch(`/api/listening/exercise?topic=${encodeURIComponent(topic)}&level=${encodeURIComponent(level)}`);
async getExercise(topic = 'all', level = 'B1', voice = null) {
let url = `/api/listening/exercise?topic=${encodeURIComponent(topic)}&level=${encodeURIComponent(level)}`;
if (voice) {
url += `&voice=${encodeURIComponent(voice)}`;
}
const resp = await fetch(url);
if (resp.ok) return await resp.json();
throw new Error(`Failed to load listening exercise: ${resp.status}`);
},
@@ -206,6 +210,14 @@ export const api = {
}
},
// Neural Speech Synthesis (TTS)
tts: {
async getStatus() {
const resp = await fetch('/api/tts/status');
return resp.ok ? await resp.json() : null;
}
},
// Bookshelf & Reader
books: {
async getAll() {