All Rounder Tools Blogger-Best blog for blogger: Speach to Text Converter Tool with colorful styling and all its features use any free library...

Wednesday, September 25, 2024

Speach to Text Converter Tool with colorful styling and all its features use any free library...

 

Speech to Text Converter

Speech to Text Converter

Converted Text:

* { box-sizing: border-box; } body { font-family: Arial, sans-serif; background-color: #e3f2fd; color: #333; margin: 0; padding: 20px; } .container { max-width: 600px; margin: 0 auto; padding: 20px; border-radius: 8px; background: #ffffff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); } h1 { text-align: center; color: #2196f3; } button { display: block; width: 100%; padding: 10px; background-color: #2196f3; color: white; border: none; border-radius: 5px; cursor: pointer; margin-bottom: 20px; } button:hover { background-color: #1976d2; } .output { margin-top: 20px; } textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px; font-family: monospace; resize: none; } #status { text-align: center; margin-top: 10px; font-weight: bold; } const startButton = document.getElementById('start-btn'); const outputText = document.getElementById('output-text'); const status = document.getElementById('status'); let recognition; if ('webkitSpeechRecognition' in window) { recognition = new webkitSpeechRecognition(); recognition.continuous = false; // Stop after one recognition recognition.interimResults = false; // Do not show interim results recognition.lang = 'en-US'; // Set the language recognition.onstart = function() { status.innerText = "Listening..."; }; recognition.onresult = function(event) { const transcript = event.results[0][0].transcript; outputText.value += transcript + ' '; status.innerText = "Conversion complete!"; }; recognition.onerror = function(event) { status.innerText = "Error occurred in recognition: " + event.error; }; recognition.onend = function() { status.innerText = "Click 'Start Listening' to continue."; }; } else { status.innerText = "Speech recognition is not supported in this browser."; } startButton.addEventListener('click', function() { if (recognition) { outputText.value = ''; // Clear previous output recognition.start(); } });

No comments:

Post a Comment