Search code examples
win-universal-appuwpvoicecortana

UWP Voice Command Set not working with multiple phrases


When trying to implement VoiceCommands, I use this set:

<Command Name="searchCommand">
  <Example>Search for UWP on Bing </Example>
  <ListenFor RequireAppName="BeforeOrAfterPhrase"> search for {search} on {service} </ListenFor>
  <Feedback>Searching for {search} on {service}</Feedback>
  <Navigate />
</Command>

I added these phrases (where the service is dynamically updated in code, this all works fine):

<PhraseList Label="service">
  <!-- Dynamic -->
</PhraseList>

<PhraseTopic Label="search" Scenario="Search">
  <!-- Dynamic -->
</PhraseTopic>

Now when I use this command, the API only seems to recognize the last phrase. So if I use 3 phrases, only the last will be recognized.

Command:          'Search for UWP on Bing'
Shows up as:      'Searching for {search} on Bing'
TextSpoken value: 'Search for UWP on Bing' (so the voice to text is working correctly)

When I use 'Search for {search}' in the ListenFor, it correctly returns the right result. But for this feature I am implementing I need 2 (or even 3) phrases in a single command.

It seems that UWP only recognizes the last phrase. Am I correct or should it be possible to use multiple phrases inside a ListenFor element?

Update June 13, 2016:

I have created a repro:

Cortana Bug repro screenshot


Solution

  • Geert, it looks like you're using Windows Insider build 14342. The issue you're seeing is due to a bug introduced in build 14341 which should be fixed in builds >= 14371.

    Hope that helps.