Is the Cortana API documentation available?

I want to integrate Cortana voice commands into a Windows Phone application. I know that the latest Wikipedia application update has been included by Cortana. At the same time, I cannot find the Cortana API documentation. Does anyone know where I can find him?

+7
documentation cortana voice-recognition windows-phone-8
source share
3 answers

Here is the complete project using Cortana: MSDN Voice Search for Windows Phone 8.1

+5
source share

There is no such thing as a Cortana API, at least for now.

What is available today, asks Cortana to launch its own application with any parameter that the user says, more information about this here: http://msdn.microsoft.com/en-us/library/dn630430.aspx

Why am I saying that there is no API for Cortana? Because you cannot programmatically ask Cortana about the weather or what you want. What you do is tell Cortana something to launch your application, and from now on, your application is an application that gives the user the necessary feedback, information, or something else.

+4
source share

You can integrate Cortana into your application:

Creating Voice Command Definitions (VCD)

<?xml version="1.0" encoding="utf-8" ?> <VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.1"> <CommandSet xml:lang="en-us" Name="HomeControlCommandSet_en-us"> <CommandPrefix>HomeControl</CommandPrefix> <Example>Control alarm, temperature, light and others</Example> <Command Name="Activate_Alarm"> <Example>Activate alarm</Example> <ListenFor>[Would] [you] [please] activate [the] alarm [please]</ListenFor> <ListenFor RequireAppName="BeforeOrAfterPhrase">Activate alarm</ListenFor> <Feedback>Activating alarm</Feedback> <Navigate /> </Command> <Command Name="Change_Temperature"> <Example>Change temperature to 25ΒΊ degrees</Example> <ListenFor>Change temperature to {temperature} degrees</ListenFor> <Feedback>Changing temperature to {temperature} degrees</Feedback> <Navigate /> </Command> <Command Name="Change_Light_Color"> <Example>Change light color to yellow</Example> <ListenFor>Change light color to {colors}</ListenFor> <Feedback>Changing light color to {colors}</Feedback> <Navigate /> </Command> <PhraseList Label="colors"> <Item>yellow</Item> <Item>green</Item> <Item>red</Item> </PhraseList> <PhraseTopic Label="temperature"> </PhraseTopic> </CommandSet> </VoiceCommands> 

VCD registration on App launch

  StorageFile vcdStorageFile = await Package.Current.InstalledLocation.GetFileAsync(@"HomeControlCommands.xml"); await VoiceCommandManager.InstallCommandSetsFromStorageFileAsync(vcdStorageFile); 

Command processing

 protected override void OnActivated(IActivatedEventArgs e) { // Handle when app is launched by Cortana if (e.Kind == ActivationKind.VoiceCommand) { VoiceCommandActivatedEventArgs commandArgs = e as VoiceCommandActivatedEventArgs; SpeechRecognitionResult speechRecognitionResult = commandArgs.Result; string voiceCommandName = speechRecognitionResult.RulePath[0]; string textSpoken = speechRecognitionResult.Text; IReadOnlyList<string> recognizedVoiceCommandPhrases; System.Diagnostics.Debug.WriteLine("voiceCommandName: " + voiceCommandName); System.Diagnostics.Debug.WriteLine("textSpoken: " + textSpoken); switch (voiceCommandName) ... } 

Further information can be found at http://talkitbr.com/2015/07/13/integrando-a-cortana-em-seu-aplicativo-windows-10/

Also, if you are interested in answering the user through the Cortana window, check this box for Cortana in the background.

+1
source share

All Articles