Web Speech Demo

Developer
Size
2,073 Kb
Views
14,168

How do I make an web speech demo?

What is a web speech demo? How do you make a web speech demo? This script and codes were developed by Wes Bos on 09 December 2022, Friday.

Web Speech Demo Previews

Web Speech Demo - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Web Speech Demo</title>
</head>
<body> <!doctype html>
<html lang="en">
<head> <meta charset="UTF-8"> <title>Document</title>
</head>
<body> <h1>Say a colour</h1> <p>Easy</p> <span style="background:PINK;">PINK</span> <span style="background:PERU;">PERU</span> <span style="background:SALMON;">SALMON</span> <span style="background:MAGENTA;">MAGENTA</span> <span style="background:WHEAT;">WHEAT</span> <span style="background:VIOLET;">VIOLET</span> <span style="background:PLUM;">PLUM</span> <span style="background:TOMATO;">TOMATO</span> <span style="background:TEAL;">TEAL</span> <span style="background:Silver;">Silver</span> <span style="background:DARKRED;">DARKRED</span> <p>Harder</p> <span style="background:lemonchiffon;">lemonchiffon</span> <span style="background:dodgerblue;">dodgerblue</span> <span style="background:cornflowerblue;">cornflowerblue</span> <span style="background:PALEGOLDENROD;">PALEGOLDENROD</span> <span style="background:STEELBLUE;">STEELBLUE</span> <span style="background:CHARTREUSE;">CHARTREUSE</span> <span style="background:lightgoldenrodyellow;">lightgoldenrodyellow</span> <style> html,body { height:100%; } body { transition:all 0.4s; font-family: sans-serif; text-align: center; } h1 { font-size: 150px; transition:all 0.4s; /*top:50%;*/ position: relative; color:rgba(0,0,0,0.4); } span { color:rgba(0,0,0,0.4); /*text-shadow:1px 1px 0 rgba(0,0,0,0.5);*/ padding:10px; display: inline-block; font-weight: 600; text-transform: uppercase; margin-bottom: 5px; } </style> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script> var speech = function(){ var x = "lol"; var recognition = new webkitSpeechRecognition(); recognition.continuous = true; recognition.interimResults = true; recognition.onresult = function(event) { var colour = event.results[event.results.length - 1][0].transcript; // make it lowercase colour = colour.toLowerCase(); // strip the spaces out of it colour = colour.replace(/\s/gi,''); $('body').css('background',colour); $('h1').text(colour); } recognition.start(); } if (!('webkitSpeechRecognition' in window)) { alert("Sorry you require a browser that supports speech recognition"); } else { speech(); } </script>
</body>
</html>
</body>
</html>
Web Speech Demo - Script Codes
Web Speech Demo - Script Codes
Home Page Home
Developer Wes Bos
Username wesbos
Uploaded December 09, 2022
Rating 4
Size 2,073 Kb
Views 14,168
Do you need developer help for Web Speech Demo?

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!

Wes Bos (wesbos) Script Codes
Create amazing sales emails with AI!

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!