feat(tts): multi-voice switcher for EN & RU, Irina default voice, punctuation pause normalization and speed calibration
This commit is contained in:
@@ -111,6 +111,7 @@ export function initSrs() {
|
||||
const listeningLevelBadge = document.getElementById('listening-level-badge');
|
||||
const listeningTopicBadge = document.getElementById('listening-topic-badge');
|
||||
const listeningTopicSelect = document.getElementById('listening-topic-select');
|
||||
const listeningVoiceSelect = document.getElementById('listening-voice-select');
|
||||
const listeningSpeedSelect = document.getElementById('listening-speed-select');
|
||||
const listeningNewScenarioBtn = document.getElementById('listening-new-scenario-btn');
|
||||
const listeningTitle = document.getElementById('listening-title');
|
||||
@@ -715,8 +716,9 @@ export function initSrs() {
|
||||
if (listeningTitle) listeningTitle.textContent = 'Загрузка аудио-ситуации...';
|
||||
|
||||
const topic = listeningTopicSelect ? listeningTopicSelect.value : 'all';
|
||||
const voice = listeningVoiceSelect ? listeningVoiceSelect.value : (localStorage.getItem('notes_tts_voice_en') || 'en_US-lessac');
|
||||
try {
|
||||
const data = await api.listening.getExercise(topic, 'B1');
|
||||
const data = await api.listening.getExercise(topic, 'B1', voice);
|
||||
currentListeningExercise = data;
|
||||
|
||||
if (listeningTitle) listeningTitle.textContent = data.title || 'Ситуация для аудирования';
|
||||
@@ -788,6 +790,14 @@ export function initSrs() {
|
||||
});
|
||||
}
|
||||
|
||||
if (listeningVoiceSelect) {
|
||||
listeningVoiceSelect.value = localStorage.getItem('notes_tts_voice_en') || 'en_US-lessac';
|
||||
listeningVoiceSelect.addEventListener('change', () => {
|
||||
localStorage.setItem('notes_tts_voice_en', listeningVoiceSelect.value);
|
||||
loadListeningExercise(true);
|
||||
});
|
||||
}
|
||||
|
||||
if (listeningForm) {
|
||||
listeningForm.addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user