0% found this document useful (0 votes)
24 views

Introduction

The document discusses JavaScript and how it can be used for speech to text recognition. JavaScript runs in the browser and can be used to build interactive web pages and forms. The code sample shows how to use the web speech API to convert speech to text and display the transcription.

Uploaded by

pardpyro
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Introduction

The document discusses JavaScript and how it can be used for speech to text recognition. JavaScript runs in the browser and can be used to build interactive web pages and forms. The code sample shows how to use the web speech API to convert speech to text and display the transcription.

Uploaded by

pardpyro
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Introduction

Java script is limited feature client side programming language .java


script run at the client end through user’s browsers
without sending massages back and forth to the server. It is widely
used by the web developers to dothings such as build dynamic
webpages, respond to events, create interactive forms, validate data
thatthe visitorenters into a form, control the browsers,etc
.JavaScript is most commonly used as a client side scripting language.
This means that JavaScript code is written into an HTML page.When
a user requests an HTML page with JavaScript in it, the script is sent
to the browser and it's up to thebrowser to do something with it.
Program code :

<!DOCTYPE html>
<html>
<head>
<style>
/* CSS comes here*/
body {
font-family: arial;
}

button {
padding: 10px;
background-color: #6a67ce;
color: #FFFFFF;
border: 0px;
cursor: pointer;
border-radius: 5px;
}

#output {
background-color: #F9F9F9;
padding: 10px;
width: 100%;
margin-top: 20px;
line-height: 30px;
}

.hide {
display: none;
}

.show {
display: block;
}
</style>
<title>JavaScript Speech to Text
</title>
</head>

<body>
<h2>JavaScript Speech to Text

</h2>
<p>Click on the below button and speak something...</p>
<p><button type="button" onclick="runSpeechRecognition()">
Speech to Text
</button>&nbsp; <span id="action">

</span>
</p>
<div id="output" class="hide">
</div>
<script>
function runSpeechRecognition() {
var output = document.getElementById("output");
var action = document.getElementById("action");
var SpeechRecognition = SpeechRecognition ||
webkitSpeechRecognition;
var recognition = new SpeechRecognition();

recognition.onstart = function () {
action.innerHTML = "<small>listening, please speak...</small>";
}

recognition.onspeechend = function () {
action.innerHTML = "<small>stopped listening, hope you are
done...</small>";
recognition.stop();
}

recognition.onresult = function (event) {


var transcript = event.results[0][0].transcript;
var confidence = event.results[0][0].confidence;
output.innerHTML = "<b>Text:</b> " + transcript + "<br/>
<b>Confidence:</b> " + confidence * 100 + "%";
output.classList.remove("hide");
}
recognition.start();
}
</script>
</html>

Output :-
Conclusion :-

Speh to Text Recognition system Provides the ability of convertwell


understandable words Due to its ability of real time
speechconversion thi stem used in various fields like ,into Automated
Car Environment, ASR System for Air traffic control usesthe hidden
Markov model , Speech recognition used for route navigation.

Refrences :-

www.firewall.cx.com
www.wikipedia.com
Objectives:
The objectives were:
Converted that told you if the speech you put in was too text
congratulated you when the text was correct.
To use Crocodile Clips correctly and learn about the different
inputs) you use.
To make sure your converted speak was correctly working through
the whole thing.
To have a correct loop that worked in the right way

You might also like