Jarvis -1.03
by velo_ninja
HTML
<!DOCTYPE html>
<html>
<head>
<title>Speech recognition</title>
<style>
#result {
border: 2px solid black;
height: 200px;
border-radius: 3px;
font-size: 14px;
white-space: pre-wrap;
overflow-y: auto;
margin-bottom: 10px;
}
#finalText {
border: 2px solid black;
height: 100px;
width: 600px;
border-radius: 3px;
font-size: 14px;
white-space: pre-wrap;
overflow-y: auto;
margin-bottom: 10px;
}
button {
position: absolute;
top: 240px;
left: 50%;
margin-right: -50%;
transform: translate(-50%, -50%);
}
#voiceStrength {
width: 200px;
height: 20px;
background-color: #eee;
position: relative;
margin-bottom: 10px;
}
#voiceStrength canvas {
display: block;
width: 100%;
height: 100%;
}
#languageDropdown {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: none;
text-align: center;
}
</style>
<script type="application/javascript">
var recognition; // Declare recognition outside the function
var isRecording = false;
var stopRecordingTimeout;
async function start() {
var resultDiv = document.getElementById("result");
var finalTextDiv = document.getElementById("finalText");
var voiceStrengthMeter = document.getElementById("voiceStrength");
var languageDropdown = document.getElementById("languageDropdown");
// Request microphone access
try {
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
...