feat(tts): multi-voice switcher for EN & RU, Irina default voice, punctuation pause normalization and speed calibration
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user