0

I'm creating a Javascript UWP for Windows 10. I have integrated Cortana, and everything works fine except one command, which needs two Phrase Topics.

Example: Get Directions from Source to Destination.

My VCD file is like this:

<Command Name="getDirections">
    <Example>MyApp get directions from New York to New Jersey</Example>
    <ListenFor>get directions from {source} to {destination}</ListenFor>
    <Feedback>Fetching directions from {source} to {destination}</Feedback>
    <VoiceCommandService Target="myBackgroundService"/>
</Command>

<PhraseTopic Label="source" Scenario="Natural Language">
      <Subject> Natural Language </Subject>
</PhraseTopic>

<PhraseTopic Label="destination" Scenario="Natural Language">
      <Subject> Natural Language </Subject>
</PhraseTopic>

But the problem is, If I create 2 Phrase topics inside my command set, then Cortana commands fails to install from VCD file (The function call to install voice commands from VCD fails).

Is there any way to use one phrase topic at two places in same listen command.

Please help me out :)

Sandeep
  • 88
  • 8
  • By "Cortana commands fails to install" do you mean the app failed to install? Or you mean the Cortana didn't start your app? – Elvis Xia - MSFT Nov 17 '16 at 08:22
  • @ElvisXia-MSFT No, app works correctly. Only the function call to install voice commands from VCD file fails. I think, only one phrase Topic is allowed per command set. But there should be some workaround, for using one phrase topic at two places. – Sandeep Nov 17 '16 at 12:34
  • @ElvisXia-MSFT Since, Commands are not being installed. Cortana can no longer activate my app. – Sandeep Nov 17 '16 at 12:44
  • I made a demo but didn't reproduce this problem, could you please check if there are tags, which have the same `Label` inside a `Commandset`? If there is no such tag, could you please share a basic demo? – Elvis Xia - MSFT Nov 18 '16 at 01:39
  • @ElvisXia-MSFT Thanks for trying it out. There are no duplicate labels. Let me try a basic demo. I will get back to you! – Sandeep Nov 18 '16 at 07:12
  • I used the official [VoiceCommandSample](https://github.com/Microsoft/Windows-universal-samples/tree/6370138b150ca8a34ff86de376ab6408c5587f5d/Samples/CortanaVoiceCommand). Pasted your VCD codes into the VCD file and delete one destination tag(there is already one there), change the `Natural Language` to any city. Run the app. Then close it. Try cortana with `AdventureWorks get directions from city1 to city2`. The app start correctly. – Elvis Xia - MSFT Nov 18 '16 at 07:58
  • @ElvisXia-MSFT Bingo! I couldn't rectify what was the problem really. But, I recreated the VCD file. And soon after commands started to register successfully. Other commands worked fine, while this particular command did not work. After restarting computer, it worked like a charm :) Thanks for your help! – Sandeep Nov 19 '16 at 05:35

0 Answers0