Speech To Text
How do I make an speech to text?
What is a speech to text? How do you make a speech to text? This script and codes were developed by Adam on 27 December 2022, Tuesday.
Speech To Text - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Speech To Text</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="cards"> <div class="card">Hello, ask me a question.</div>
</div>
<button class="ask">ask</button> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Speech To Text - Script Codes CSS Codes
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,600,300);
body { background-color: #EEE; font-family: 'Open Sans', sans-serif;
}
.cards { max-width: 500px; margin: 15px auto 0 auto;
}
.cards .card { background-color: #FFF; box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1); padding: 15px 20px 15px 20px; margin: 0 5px 15px 5px;
}
.ask { position: absolute; bottom: 20px; left: 50%; height: 50px; width: 50px; border-radius: 50%; border: none; background-color: #364A5E; color: #FFF;
}
Speech To Text - Script Codes JS Codes
if (!('webkitSpeechRecognition' in window)) { alert('Your browser sucks... :(')
}else{ var recognizing = false, ignore_onend = false, final_transcript, previousQuestion; var recognition = new webkitSpeechRecognition(); recognition.continuous = true; recognition.interimResults = true; recognition.onstart = function() { recognizing = true; // Show Listening Indicator here... }; recognition.onerror = function(event) { if (event.error == 'no-speech') { console.log('info_no_speech'); ignore_onend = true; } if (event.error == 'audio-capture') { console.log('info_no_microphone'); ignore_onend = true; } if (event.error == 'not-allowed') { if (event.timeStamp - start_timestamp < 100) { showInfo('info_blocked'); } else { showInfo('info_denied'); } ignore_onend = true; } }; recognition.onend = function() { recognizing = false; if (ignore_onend) { return; } if (!final_transcript) { showInfo('info_start'); return; } /*showInfo(''); if (window.getSelection) { window.getSelection().removeAllRanges(); var range = document.createRange(); range.selectNode(document.getElementById('final_span')); window.getSelection().addRange(range); } if (create_email) { create_email = false; createEmail(); }*/ }; recognition.onresult = function(event) { var interim_transcript = ''; for (var i = event.resultIndex; i < event.results.length; ++i) { if (event.results[i].isFinal) { final_transcript += event.results[i][0].transcript; } else { interim_transcript += event.results[i][0].transcript; } } if(final_transcript.length > 0 && final_transcript !== previousQuestion){ $('.cards').append('<div class="card">'+final_transcript+'</div>'); var utterance = new SpeechSynthesisUtterance(final_transcript); window.speechSynthesis.speak(utterance); } previousQuestion = final_transcript; recognition.stop(); };
}
$('.ask').click(function(){ if (recognizing) { recognition.stop(); return; } final_transcript = ''; recognition.start(); ignore_onend = false; start_timestamp = event.timeStamp; $.ajaxSetup({xhrFields: { withCredentials: true } });
});
Developer | Adam |
Username | adamjacob |
Uploaded | December 27, 2022 |
Rating | 3 |
Size | 3,109 Kb |
Views | 6,072 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Loading... | 2,384 Kb |
Weather Widget | 3,451 Kb |
A Pen by Adam | 3,348 Kb |
Bouncy Box | 2,157 Kb |
Loading | 2,300 Kb |
Emojify It | 4,371 Kb |
Hover Menu | 2,361 Kb |
CSS Triangle Shadow | 1,714 Kb |
Blog Card | 2,494 Kb |
Inline SVG with ReactJS | 2,012 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Two Element Typeface | Chrisota | 4,942 Kb |
Out of the blue | Giaco | 2,537 Kb |
Flat buttons for Eliassen.com | Kdooley89 | 1,737 Kb |
Wikipedia Viewer | Codinger | 4,681 Kb |
Search field | Jamesbarnett | 2,100 Kb |
Expandable Left Side Bar with jQuery animate | Retrofuturistic | 2,483 Kb |
Buttons with style | Chbymnky | 2,082 Kb |
Drop Cap | Gsaiki | 1,571 Kb |
React Vote Component | Souporserious | 5,465 Kb |
Shopping cart | Andiio | 6,581 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!