loadVoices() { const voices = this.synth.getVoices(); this.voiceSelect.innerHTML = '<option value="">Default Voice</option>'; voices.forEach(voice => { const option = document.createElement('option'); option.value = voice.name; option.textContent = `${voice.name} (${voice.lang})`; this.voiceSelect.appendChild(option); }); }
pause() { if (this.synth.speaking && !this.synth.paused) { this.synth.pause(); this.showNotification('⏸️ Speech paused', 'info'); } }
// Add animations to styles const style = document.createElement('style'); style.textContent = ` @keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.presets h3 { font-size: 14px; color: #666; margin-bottom: 10px; }
textarea { width: 100%; padding: 15px; border: 2px solid #e0e0e0; border-radius: 10px; font-size: 16px; font-family: inherit; resize: vertical; transition: border-color 0.3s; }
// Initialize Eric TTS document.addEventListener('DOMContentLoaded', () => { window.ericTTS = new EricTTS(); }); // Save/Load Settings class Settings { saveSettings() { const settings = { rate: document.getElementById('rate').value, pitch: document.getElementById('pitch').value, voice: document.getElementById('voiceSelect').value }; localStorage.setItem('ericTTS_settings', JSON.stringify(settings)); } loadSettings() { const saved = localStorage.getItem('ericTTS_settings'); if (saved) { const settings = JSON.parse(saved); document.getElementById('rate').value = settings.rate; document.getElementById('pitch').value = settings.pitch; document.getElementById('voiceSelect').value = settings.voice; } } }
.button-group { display: flex; gap: 10px; margin: 20px 0; flex-wrap: wrap; }