SpeechRecognition实现浏览器端语音识别成文字搜索框输入效果代码

代码语言:html

所属分类:搜索

代码描述:SpeechRecognition实现浏览器端语音识别成文字搜索框输入效果代码

代码标签: SpeechRecognition 浏览器 语音 识别 文字 搜索框 输入

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  

<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/all.6.0.css">
  
<style>
@import url("https://fonts.googleapis.com/css?family=Kanit");
* {
  box-sizing: border-box;
}

body {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #282c34;
  font-family: "Kanit", sans-serif;
}

h1 {
  color: #fff;
  font-size: 50px;
}

#mic {
  display: inline-block;
  margin: 50px 0;
  font-size: 80px;
  line-height: 170px;
  height: 180px;
  width: 180px;
  text-align: center;
  border-radius: 50%;
  transition: all 0.2s linear;
  cursor: pointer;
}
#mic.fa-microphone {
  border: 5px solid #3ba9f4;
  color: #3ba9f4;
}
#mic.fa-microphone:hover {
  color: #9fea63;
  border-color: #9fea63;
}
#mic.fa-microphone-slash {
  border: 5px solid #ff0000;
  color: #ff0000;
}
#mic.fa-microphone-slash:hover {
  color: #fff;
  border-color: #fff;
}

#text {
  display: block;
  height: 50px;
  width: 500px;
  font-size: 25px;
  padding: 15px;
  border: 2px solid #3ba9f4;
  background-color: transparent;
 .........完整代码请登录后点击上方下载按钮下载查看

网友评论0