1

I'm trying to implement Voice Control into my app.
I followed this guide on the Tizen Docs.
I fixed some syntax errors in the guide's code, but it still didn't work. I don't get any errors, but the results don't show up.

Any help would be appreciated. Thanks.
Here is my code:

var initializeVoiceControlClient = () => {
  return tizen.voicecontrol.getVoiceControlClient();
};

/* Listener */
var languageChangeListenerCallback = function (previous, current) {
  console.log("Language change callback " + previous + "->" + current);
};

/* Add */
var addCurrentLanguageChanged = () => {
  var id = client.addLanguageChangeListener(languageChangeListenerCallback);
};

/* Remove */
var removeCurrentLanguageChanged = () => {
  var id = client.addLanguageChangeListener(languageChangeListenerCallback);

  client.removeLanguageChangeListener(id);
};

/* Listener */
var resultListenerCallback = function (event, list, result) {
  console.log("Result callback - event: " + event + ", result: " + result);
};

/* Add */
var addResultListener = () => {
  var id = client.addResultListener(resultListenerCallback);
};

/* Remove */
var removeResultListener = () => {
  var id = client.addResultListener(resultListenerCallback);

  client.removeResultListener(id);
};

var createCommandList = () => {
  var command = new tizen.VoiceControlCommand("hello");
  var commands = [command];
  client.setCommandList(commands);
};

var getCurrentLang = () => {
  var currentLanguage = client.getCurrentLanguage();
  console.log("Current language is: " + currentLanguage);

  /*
       Expected output:
       Current language is: en_US
    */
};

var client = initializeVoiceControlClient();
createCommandList();
getCurrentLang();
addResultListener();
Andrej
  • 2,743
  • 2
  • 11
  • 28
  • I'm currently looking to add voice control support for a watch app myself too. I've confirmed three capabilities: `speech.recognition`, `speech.control` and `microphone`. All three are supported according to runtime and they're added to the config.xml. Additionally, even setting microphone permission to true in settings app on the watch does solve a "permission denied" error, but still doesn't do anything else. I've looked on Github, there are no working examples of this code on galaxy watches whatsoever. Not on samsung forums either. I think it's just incorrectly documented as supported. – Azeirah Jan 03 '22 at 16:03
  • I don't know really, moved to Wear OS... I haven't looked into this in a year. Hope you manage to find a solution to your problem. – Andrej Jan 11 '22 at 11:11

0 Answers0