text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0cf4a6"],{"62a5":function(e,t,n){"use strict";n.r(t);var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"Speech"},[n("div",[n("h3",[e._v("语音识别")]),n("textarea",{directives:[{name:"model",rawName:"v-model",value:e.text,expression:"text"}],attrs:{name:"",cols:"30",rows:"10",placeholder:"语音识别似乎需要翻墙"},domProps:{value:e.text},on:{input:function(t){t.target.composing||(e.text=t.target.value)}}}),n("button",{on:{click:e.start}},[e._v(e._s("1"===e.state?"开始":"2"===e.state?"识别中···":""))]),n("button",{directives:[{name:"show",rawName:"v-show",value:"2"===e.state,expression:"state === '2'"}],on:{click:e.stop}},[e._v("结束")])]),n("div",[n("h3",[e._v("文字转语音")]),n("textarea",{directives:[{name:"model",rawName:"v-model",value:e.message,expression:"message"}],attrs:{name:"",cols:"30",rows:"10"},domProps:{value:e.message},on:{input:function(t){t.target.composing||(e.message=t.target.value)}}}),n("button",{on:{click:e.transform}},[e._v("转换")])])])},s=[],i={name:"Speech",data:function(){return{newRecognition:null,text:"",state:"1",message:""}},methods:{start:function(){this.state="2",this.newRecognition.start()},stop:function(){this.state="1",this.newRecognition.stop()},transform:function(){this.speak(this.message)},speak:function(e){var t=new SpeechSynthesisUtterance;t.text=e,t.volume=1,t.rate=1,t.pitch=1,window.speechSynthesis.speak(t)},close:function(){window.speechSynthesis.stop()}},mounted:function(){var e=window.SpeechRecognition||window.webkitSpeechRecognition;this.newRecognition=new e,this.newRecognition.continuous=!0,this.newRecognition.onresult=function(e){console.log(e)},this.newRecognition.onerror=function(e){console.log(e)},this.newRecognition.onstart=function(e){console.log(e)},this.newRecognition.onspeechend=function(e){console.log(e)}}},a=i,c=n("2877"),r=Object(c["a"])(a,o,s,!1,null,null,null);t["default"]=r.exports}}]);