4

I am trying to modify the VCD I created dynamically from the app. I refered to various articles/documentations. I have the following code:

Windows.ApplicationModel.VoiceCommands.VoiceCommnadDefinition.VoiceCommandSet commandSetEnUs;

        if (Windows.ApplicationModel.VoiceCommands.VoiceCommandDefinitionManager.
              InstalledCommandSets.TryGetValue(
                "AdventureWorksCommandSet_en-us", out commandSetEnUs))
        {
            await commandSetEnUs.SetPhraseListAsync(
              "destination", new string[] {“London”, “Dallas”, “New York”, “Phoenix”});

I used it in my application and it states there is no class named VoiceComands under ApplicationModel. I thought it might be for windows 10, so I dug deeper and came up with a VoiceCommandManager class which also doesn't have the enumerations I need. Can anyone help me to dynamically modify my Windows Phone 8.1(RunTime) VCD. Thanks in advance.

iam.Carrot
  • 4,976
  • 2
  • 24
  • 71

1 Answers1

1
        Windows.Media.SpeechRecognition.VoiceCommandSet commandSetEnUs;

        if (Windows.Media.SpeechRecognition.VoiceCommandManager.InstalledCommandSets.TryGetValue("AdventureWorksCommandSet_en-us", out commandSetEnUs))
        {
            await commandSetEnUs.SetPhraseListAsync(
              "destination", new string[] { "London", "Dallas", "New York", "Phoenix" });
        }
DevEnitly
  • 393
  • 1
  • 10
  • 1
    Thank you for the reply. This doesn't work. It gives me an error at the VoiceCommandService stating it doesn't exist in the current context and gives the standard fixes (Generate a method and etc). any idea if they have changed the API to something else? – iam.Carrot Dec 15 '15 at 06:56
  • Sorry my bad I tested it in a Silverlight App. I see what I can find. I know I used it in a 8.1 Runtime App before. – DevEnitly Dec 15 '15 at 16:29
  • Please do. I am quite on the line here. I need to modify a vcd file dynamically using c# for windows phone 8.1(RunTime). – iam.Carrot Dec 18 '15 at 10:35
  • I edited my Answer it should now work on Windows Phone 8.1 RT. The documentation is terrible the changed it all to Windows 10 without leaving a trail. – DevEnitly Dec 19 '15 at 13:45
  • Thanks the code works just fine and yes they did do a sad job on the documentation no trails at all. – iam.Carrot Dec 19 '15 at 18:12