newDictation
听写对象允许你通过简单几行代码创建简单的听写。
例子
var settings = {
continuous:true, // Don't stop never because i have https connection
onResult:function(text){
// Show the Recognized text in the console
console.log("Recognized text: ", text);
},
onStart:function(){
console.log("Dictation started by the user");
},
onEnd:function(){
alert("Dictation stopped by the user");
}
};
var UserDictation = artyom.newDictation(settings);
// Link the events to buttons in the document
$("#button-start").click(function(){
// Start the Dictation
UserDictation.start();
});
$("#button-stop").click(function(){
// Stop the Dictation
UserDictation.stop();
});Last updated
Was this helpful?