UNPKG

voicescribe

Version:

Live speech transcription library with multi-language support.

38 lines (33 loc) 958 B
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>VoiceScribe Demo</title> </head> <body> <h1>VoiceScribe Live Transcription</h1> <select id="language"> <option value="en-US">English (US)</option> <option value="fr-FR">French</option> <option value="es-ES">Spanish</option> <option value="de-DE">German</option> </select> <button onclick="start()">Start</button> <button onclick="stop()">Stop</button> <div id="output" style="margin-top: 20px; font-size: 1.2em;"></div> <script type="module"> import VoiceScribe from './index.js'; const output = document.getElementById('output'); const langSelect = document.getElementById('language'); window.start = () => { VoiceScribe.setLanguage(langSelect.value); VoiceScribe.start((text) => { output.textContent = text; }); }; window.stop = () => { VoiceScribe.stop(); }; </script> </body> </html>