zoukankan      html  css  js  c++  java
  • MUI 语音搜索框

    <div id="search-area">
    <div class="mui-input-row mui-search mui-active" style=" 85vw; display: inline-block;margin-left: 5px;">
    <input id="search" type="search" class="mui-input-speech mui-input-clear" placeholder="" data-input-clear="2" data-input-speech="2" data-input-search="2">
    <span class="mui-icon mui-icon-clear mui-hidden"></span>
    <span class="mui-icon mui-icon-speech"></span>
    <span class="mui-placeholder">
    <span class="mui-icon mui-icon-search" id="search-btn"></span>
    <span>带语音输入的搜索框</span>
    </span>
    </div>
    <div id="search-text">搜索</div>
    </div>

      

    	//	语音输入
    	var text = null;
    
    	function startRecognize() {
    		var options = {};
    		options.engine = 'iFly';
    		options.punctuation = false; // 是否需要标点符号 
    		text = "";
    		console.log("开始语音识别:");
    		plus.speech.startRecognize(options, function(s) {
    			console.log(s);
    			text += s;
    			document.getElementById('search').value = text;
    		}, function(e) {
    			console.log("语音识别失败:" + e.message);
    			alert("语音识别失败:" + e.message);
    		});
    		setTimeout(stopRecognize, 10000);
    	}
    //	停止语音输入
    	function stopRecognize() {
    		plus.speech.stopRecognize();
    	}
    

      

  • 相关阅读:
    <c:forTokens/>标签
    小小的心得
    wordcount编写和提交集群运行问题解决方案
    全国主要城市空气质量
    模拟迁途箭头圆圈
    模拟迁途.html
    大规模markpoint特效
    hadoop例子程序:求圆周率和wordcount
    测试
    hadoop集群安装好之后的启动操作
  • 原文地址:https://www.cnblogs.com/RAINHAN/p/7125177.html
Copyright © 2011-2022 走看看