Changes to use the new speech API - TC-662 18/24018/1 submit/tizen_ivi/20140708.220226
authorbrianjjones <brian.j.jones@intel.com>
Tue, 8 Jul 2014 00:04:49 +0000 (17:04 -0700)
committerbrianjjones <brian.j.jones@intel.com>
Tue, 8 Jul 2014 00:05:08 +0000 (17:05 -0700)
Change-Id: Ic9c5fef9e4d888476129d6c663d0e27e68d3eddc

js/services/speech.js
packaging/modello-common.changes

index dd3fd49..0787c30 100644 (file)
@@ -54,26 +54,8 @@ var Speech = (function() {
                console.log("Speech init voice recognition called.");
                if (typeof (tizen) !== 'undefined' && typeof (tizen.speech) !== 'undefined' && typeof (tizen.speech.setCBListener) !== 'undefined') {
                        try {
-                               var speechEventListener = {
-                                       onaudiostart : function() {
-                                               console.log("Speech: onaudiostart received");
-                                       },
-                                       onsoundstart : function() {
-                                               console.log("Speech: onsoundstart received");
-                                       },
-                                       onspeechstart : function() {
-                                               console.log("Speech: onspeechstart received");
-                                       },
-                                       onspeechend : function() {
-                                               console.log("Speech: onspeechend received");
-                                       },
-                                       onsoundend : function() {
-                                               console.log("Speech: onsoundend received");
-                                       },
-                                       onaudioend : function() {
-                                               console.log("Speech: onaudioend received");
-                                       },
-                                       onresult : function(result) {
+
+                               tizen.speech.setCBListener(function(result) {
                                                console.log("Speech: onresult received");
                                                for ( var i = 0; i < result.length; i++) {
                                                        console.log("Speech: forloop, command = " + result[i]);
@@ -139,21 +121,7 @@ var Speech = (function() {
                                                                break;
                                                        }
                                                }
-                                       },
-                                       onnomatch : function(result) {
-                                               console.log("Speech: onnomatch received ");
-                                       },
-                                       onerror : function(error) {
-                                               console.log("Speech: onerror received");
-                                       },
-                                       onstart : function() {
-                                               console.log("Speech: onstart received");
-                                       },
-                                       onend : function() {
-                                               console.log("Speech: onend received");
-                                       }
-                               };
-                               tizen.speech.setCBListener(speechEventListener);
+                                       });
                        } catch (err) {
                                console.log("Speech set callback listener FAILED + " + err.message);
                                console.log(err);
@@ -251,4 +219,4 @@ var Speech = (function() {
 
        window.__speech = undefined === window.__speech ? new Speech() : window.__speech;
        return window.__speech;
-})();
\ No newline at end of file
+})();
index 554ba35..70e4ecd 100644 (file)
@@ -1,3 +1,6 @@
+* Mon Jul 07 2014 brianjjones <brian.j.jones@intel.com> accepted/tizen/ivi/20140702.153329-1-g961a50d
+- Changes to use the new speech API - TC-662
+
 * Tue Jul 01 2014 brianjjones <brian.j.jones@intel.com> submit/tizen_ivi/20140701.201509-1-g13d7b63
 - Adding some checks to ensure objects aren't undefined before using them
 - Removing semicolon