Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
shahid
Product and Topic Expert
Product and Topic Expert

Using speech webkit for an Input field to accept the voice command for an event to trigger in SAPUI5 Application.


Demo Video: https://www.youtube.com/watch?v=B3RvdfcLOW8

var vlayout = new c.layout.MatrixLayout();

var vpanel = new c.Panel().setText("Quick Links");

  • vpanel.addContent(new c.Button("myButton",{

text: "Click here to Navigate thru Speech",

tooltip: "please click me",

press: function() {

$('#myButton').after('<input id="mic" onwebkitspeechchange="transcribe(this.value)" x-webkit-speech>');

function transcribe(words) {

  1. document.getElementById("mic").value = words;

if (words == null) {

alert("No keyword assigned-" + words );

} else if (words == "1") {

  • oShell.setSelectedWorksetItem("wi_home_guest");

  • oShell.setContent(getContent("wi_home_guest"));

}

2 Comments