local_silero_tts:index.html
index.html
- index.html
<!DOCTYPE html> <html lang="ru"> <head> <meta charset="UTF-8"> <title>Локальный Silero TTS</title> <style> body { font-family: Arial, sans-serif; max-width: 600px; margin: 50px auto; padding: 20px; background: #f4f4f9; } textarea { width: 100%; height: 250px; padding: 10px; font-size: 16px; border-radius: 5px; border: 1px solid #ccc; box-sizing: border-box; } select, button { padding: 10px 20px; font-size: 16px; margin-top: 15px; border-radius: 5px; border: none; cursor: pointer; } button { background: #28a745; color: white; font-weight: bold; } button:disabled { background: #ccc; } #status { margin-top: 15px; color: #555; font-style: italic; } </style> </head> <body> <h1>Локальный русский голос (Silero v5)</h1> <textarea id="text-input">Привет! На двери висит дверной замок, а в поле стоит каменный замок. Озвучь это.</textarea> <label for="speaker-select">Голос:</label> <select id="speaker-select"> <option value="baya">Зая (Женский унизительный)</option> <option value="kseniya">Ксения (Женский стандарт)</option> <option value="eugene">Евгений (Мужской диктор)</option> <option value="aidar">Айдар (Мужской мягкий)</option> </select> <button id="say-btn">Озвучить текст</button> <br><br> <audio id="audio-player" controls style="width: 100%;"></audio> <div id="status">Готов к работе</div> <script> const btn = document.getElementById('say-btn'); const status = document.getElementById('status'); const player = document.getElementById('audio-player'); btn.addEventListener('click', () => { const text = encodeURIComponent(document.getElementById('text-input').value); const speaker = document.getElementById('speaker-select').value; btn.disabled = true; status.innerText = "Воспроизведение звука..."; // Прямая трансляция потока байт в плеер без создания файлов на диске! player.src = `http://localhost:3000/api/stream-audio?text=${text}&speaker=${speaker}&t=${Date.now()}`; player.play(); player.onended = () => { status.innerText = "Готово!"; btn.disabled = false; }; }); </script> </body> </html>
Только авторизованные участники могут оставлять комментарии.
local_silero_tts/index.html.txt · Последнее изменение: — VladPolskiy
