SlideShare a Scribd company logo
1 of 19
Handsfree with Cortana
“
I’m Fiyaz Hasan
#Versatile #Tech #Developer
I’m a .NET and JavaScript enthusiast. I like to work with
different technologies on different platforms. I love the
logic and structure of coding and always strives to write
more elegant and efficient code. I’m passionate about
design patterns and applying Software Engineering best
practices.
www.fiyazhasan.me
Hey Cortana, Who am I?
You are Fizz
Hey Cortana, Who are you?
I am Cortana
Integrating with Cortana in 3 simple steps
Create Voice
Command
Definition (s)
Register VCD on
App Startup
Handle Voice
Command
Activation
“
CREATING VOICE COMMAND
DEFINATION(S)
Step 1
<?xml version="1.0" encoding="utf-8"?>
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2">
<CommandSet xml:lang="en-us" Name="MySimpleTodoCommandSet_en-us">
<CommandPrefix> My Simple To do </CommandPrefix>
<Example> pending tasks </Example>
<Command Name="todoBackgroundCommandList">
<Example> pending tasks </Example>
<ListenFor> {command} task[s] </ListenFor>
<Feedback> Executing specific command </Feedback>
<VoiceCommandService Target="SimpleTodoVoiceCommandService"/>
</Command>
<PhraseTopic Label="command" Scenario="Search">
<Subject> pending </Subject>
</PhraseTopic>
</CommandSet>
</VoiceCommands>
Create Voice Command Definition(s)
Note: the VCD is identical for JavaScript and C# apps
<?xml version="1.0" encoding="utf-8"?>
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2">
<CommandSet xml:lang="en-us" Name="MySimpleTodoCommandSet_en-us">
<CommandPrefix> My Simple To do </CommandPrefix>
<Example> pending tasks </Example>
<Command Name="todoBackgroundCommandList">
<Example> pending tasks </Example>
<ListenFor> {command} task[s] </ListenFor>
<Feedback> Executing specific command </Feedback>
<VoiceCommandService Target="SimpleTodoVoiceCommandService"/>
</Command>
<PhraseTopic Label="command" Scenario="Search">
<Subject> pending </Subject>
</PhraseTopic>
</CommandSet>
</VoiceCommands>
<CommandPrefix> My Simple To do </CommandPrefix>
Step 1
<?xml version="1.0" encoding="utf-8"?>
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2">
<CommandSet xml:lang="en-us" Name="MySimpleTodoCommandSet_en-us">
<CommandPrefix> My Simple To do </CommandPrefix>
<Example> pending tasks </Example>
<Command Name="todoBackgroundCommandList">
<Example> pending tasks </Example>
<ListenFor> {command} task[s] </ListenFor>
<Feedback> Executing specific command </Feedback>
<VoiceCommandService Target="SimpleTodoVoiceCommandService"/>
</Command>
<PhraseTopic Label="command" Scenario="Search">
<Subject> pending </Subject>
</PhraseTopic>
</CommandSet>
</VoiceCommands>
<Example> pending tasks </Example>
Step 1
<?xml version="1.0" encoding="utf-8"?>
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2">
<CommandSet xml:lang="en-us" Name="MySimpleTodoCommandSet_en-us">
<CommandPrefix> My Simple To do </CommandPrefix>
<Example> pending tasks </Example>
<Command Name="todoBackgroundCommandList">
<Example> pending tasks </Example>
<ListenFor> {command} task[s] </ListenFor>
<Feedback> Executing specific command </Feedback>
<VoiceCommandService Target="SimpleTodoVoiceCommandService"/>
</Command>
<PhraseTopic Label="command" Scenario="Search">
<Subject> pending </Subject>
</PhraseTopic>
</CommandSet>
</VoiceCommands>
<Command Name="todoBackgroundCommandList">
<Example> pending tasks </Example>
<ListenFor> {command} task[s] </ListenFor>
<Feedback> showing {command} tasks </Feedback>
<VoiceCommandService
Target="SimpleTodoVoiceCommandService"/>
</Command>
Step 1
<?xml version="1.0" encoding="utf-8"?>
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2">
<CommandSet xml:lang="en-us" Name="MySimpleTodoCommandSet_en-us">
<CommandPrefix> My Simple To do </CommandPrefix>
<Example> pending tasks </Example>
<Command Name="todoBackgroundCommandList">
<Example> pending tasks </Example>
<ListenFor> {command} task[s] </ListenFor>
<Feedback> Executing specific command </Feedback>
<VoiceCommandService Target="SimpleTodoVoiceCommandService"/>
</Command>
<PhraseTopic Label="command" Scenario="Search">
<Subject> pending </Subject>
</PhraseTopic>
</CommandSet>
</VoiceCommands>
<Example> pending tasks </Example>
Step 1
<?xml version="1.0" encoding="utf-8"?>
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2">
<CommandSet xml:lang="en-us" Name="MySimpleTodoCommandSet_en-us">
<CommandPrefix> My Simple To do </CommandPrefix>
<Example> pending tasks </Example>
<Command Name="todoBackgroundCommandList">
<Example> pending tasks </Example>
<ListenFor> {command} task[s] </ListenFor>
<Feedback> Executing specific command </Feedback>
<VoiceCommandService Target="SimpleTodoVoiceCommandService"/>
</Command>
<PhraseTopic Label="command" Scenario="Search">
<Subject> pending </Subject>
</PhraseTopic>
</CommandSet>
</VoiceCommands>
<ListenFor> {command} task[s] </ListenFor>
Step 1
<?xml version="1.0" encoding="utf-8"?>
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2">
<CommandSet xml:lang="en-us" Name="MySimpleTodoCommandSet_en-us">
<CommandPrefix> My Simple To do </CommandPrefix>
<Example> pending tasks </Example>
<Command Name="todoBackgroundCommandList">
<Example> pending tasks </Example>
<ListenFor> {command} task[s] </ListenFor>
<Feedback> Executing specific command </Feedback>
<VoiceCommandService Target="SimpleTodoVoiceCommandService"/>
</Command>
<PhraseTopic Label="command" Scenario="Search">
<Subject> pending </Subject>
</PhraseTopic>
</CommandSet>
</VoiceCommands>
<Feedback> Executing specific command </Feedback>
Step 1
<?xml version="1.0" encoding="utf-8"?>
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2">
<CommandSet xml:lang="en-us" Name="MySimpleTodoCommandSet_en-us">
<CommandPrefix> My Simple To do </CommandPrefix>
<Example> pending tasks </Example>
<Command Name="todoBackgroundCommandList">
<Example> pending tasks </Example>
<ListenFor> {command} task[s] </ListenFor>
<Feedback> Executing specific command </Feedback>
<VoiceCommandService Target="SimpleTodoVoiceCommandService"/>
</Command>
<PhraseTopic Label="command" Scenario="Search">
<Subject> pending </Subject>
</PhraseTopic>
</CommandSet>
</VoiceCommands>
<VoiceCommandService Target="SimpleTodoVoiceCommandService"/>
Step 1
<?xml version="1.0" encoding="utf-8"?>
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2">
<CommandSet xml:lang="en-us" Name="MySimpleTodoCommandSet_en-us">
<CommandPrefix> My Simple To do </CommandPrefix>
<Example> pending tasks </Example>
<Command Name="todoBackgroundCommandList">
<Example> pending tasks </Example>
<ListenFor> {command} task[s] </ListenFor>
<Feedback> Executing specific command </Feedback>
<VoiceCommandService Target="SimpleTodoVoiceCommandService"/>
</Command>
<PhraseTopic Label="command" Scenario="Search">
<Subject> pending </Subject>
</PhraseTopic>
</CommandSet>
</VoiceCommands>
<PhraseTopic Label="command" Scenario="Search">
<Subject> pending </Subject>
</PhraseTopic>
Step 1
“
Register VCD XML file on App
Startup
private async Task RegisterVoiceCommands()
{
var storageFile =
await StorageFile.GetFileFromApplicationUriAsync(
new Uri("ms-appx:///MySimpleTodoCommands.xml"));
await
VoiceCommandDefinitionManager
.InstallCommandDefinitionsFromStorageFileAsync(storageFile);
}
Step 2
Register VCD XML file on App Startup
Step 1
“
Handle Voice Command
Activation
Step 3
Step 1
Step 2
Handle Voice Command Activation
var triggerDetails = taskInstance.TriggerDetails as AppServiceTriggerDetails;
if (triggerDetails?.Name == "SimpleTodoVoiceCommandService")
{
_deferral = taskInstance.GetDeferral();
var cancelledTokenSource = new CancellationTokenSource();
_voiceServiceConnection =
VoiceCommandServiceConnection.FromAppServiceTriggerDetails(triggerDetails);
var voiceCommand = await _voiceServiceConnection.GetVoiceCommandAsync();
switch (voiceCommand.CommandName)
{
case "todoBackgroundCommandList":
var command = voiceCommand.Properties["command"][0];
if (command == "pending")
await ();
break;
default:
();
break;
}
}

More Related Content

Similar to Hands free with cortana

TDC 2014 - Cortana
TDC 2014 - CortanaTDC 2014 - Cortana
TDC 2014 - Cortanatmonaco
 
Lev's KC-DC Presentation
Lev's KC-DC PresentationLev's KC-DC Presentation
Lev's KC-DC PresentationLev Ginsburg
 
Building Windows 10 Universal Apps with Speech and Cortana
Building Windows 10 Universal Apps with Speech and CortanaBuilding Windows 10 Universal Apps with Speech and Cortana
Building Windows 10 Universal Apps with Speech and CortanaNick Landry
 
ITT 2014 - Matt Brenner- Localization 2.0
ITT 2014 - Matt Brenner- Localization 2.0ITT 2014 - Matt Brenner- Localization 2.0
ITT 2014 - Matt Brenner- Localization 2.0Istanbul Tech Talks
 
Windows Phone 8 - 14 Using Speech
Windows Phone 8 - 14 Using SpeechWindows Phone 8 - 14 Using Speech
Windows Phone 8 - 14 Using SpeechOliver Scheer
 
Ui testing with splinter - Fri, 30 May 2014
Ui testing with splinter - Fri, 30 May 2014Ui testing with splinter - Fri, 30 May 2014
Ui testing with splinter - Fri, 30 May 2014Taizo Ito
 
Speech for Windows Phone 8
Speech for Windows Phone 8Speech for Windows Phone 8
Speech for Windows Phone 8Marco Massarelli
 
Speech for Windows Phone 8
Speech for Windows Phone 8Speech for Windows Phone 8
Speech for Windows Phone 8Appsterdam Milan
 
Use Web Skills To Build Mobile Apps
Use Web Skills To Build Mobile AppsUse Web Skills To Build Mobile Apps
Use Web Skills To Build Mobile AppsNathan Smith
 
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdfLearn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdfClapperboardCinemaPV
 
SumanKAdinarayana_CommandPromptBasics_TipsNTricksPage1_10Apr2022.pdf
SumanKAdinarayana_CommandPromptBasics_TipsNTricksPage1_10Apr2022.pdfSumanKAdinarayana_CommandPromptBasics_TipsNTricksPage1_10Apr2022.pdf
SumanKAdinarayana_CommandPromptBasics_TipsNTricksPage1_10Apr2022.pdfSuman K Adinarayana
 
Plug yourself in and your app will never be the same (1 hr edition)
Plug yourself in and your app will never be the same (1 hr edition)Plug yourself in and your app will never be the same (1 hr edition)
Plug yourself in and your app will never be the same (1 hr edition)Mikkel Flindt Heisterberg
 
Selenium tutorial
Selenium tutorialSelenium tutorial
Selenium tutorialmindqqa
 
Code Camp - Presentation - Windows 10 - (Cortana)
Code Camp - Presentation - Windows 10 - (Cortana)Code Camp - Presentation - Windows 10 - (Cortana)
Code Camp - Presentation - Windows 10 - (Cortana)Edward Moemeka
 
Plug-in Architectures
Plug-in ArchitecturesPlug-in Architectures
Plug-in Architectureselliando dias
 
Selenium Open Source Tool
Selenium Open Source ToolSelenium Open Source Tool
Selenium Open Source Toolonlinemindq
 

Similar to Hands free with cortana (20)

TDC 2014 - Cortana
TDC 2014 - CortanaTDC 2014 - Cortana
TDC 2014 - Cortana
 
Lev's KC-DC Presentation
Lev's KC-DC PresentationLev's KC-DC Presentation
Lev's KC-DC Presentation
 
Building Windows 10 Universal Apps with Speech and Cortana
Building Windows 10 Universal Apps with Speech and CortanaBuilding Windows 10 Universal Apps with Speech and Cortana
Building Windows 10 Universal Apps with Speech and Cortana
 
Tml for Laravel
Tml for LaravelTml for Laravel
Tml for Laravel
 
ITT 2014 - Matt Brenner- Localization 2.0
ITT 2014 - Matt Brenner- Localization 2.0ITT 2014 - Matt Brenner- Localization 2.0
ITT 2014 - Matt Brenner- Localization 2.0
 
Windows Phone 8 - 14 Using Speech
Windows Phone 8 - 14 Using SpeechWindows Phone 8 - 14 Using Speech
Windows Phone 8 - 14 Using Speech
 
Ui testing with splinter - Fri, 30 May 2014
Ui testing with splinter - Fri, 30 May 2014Ui testing with splinter - Fri, 30 May 2014
Ui testing with splinter - Fri, 30 May 2014
 
Speech for Windows Phone 8
Speech for Windows Phone 8Speech for Windows Phone 8
Speech for Windows Phone 8
 
Speech for Windows Phone 8
Speech for Windows Phone 8Speech for Windows Phone 8
Speech for Windows Phone 8
 
Use Web Skills To Build Mobile Apps
Use Web Skills To Build Mobile AppsUse Web Skills To Build Mobile Apps
Use Web Skills To Build Mobile Apps
 
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdfLearn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
 
SumanKAdinarayana_CommandPromptBasics_TipsNTricksPage1_10Apr2022.pdf
SumanKAdinarayana_CommandPromptBasics_TipsNTricksPage1_10Apr2022.pdfSumanKAdinarayana_CommandPromptBasics_TipsNTricksPage1_10Apr2022.pdf
SumanKAdinarayana_CommandPromptBasics_TipsNTricksPage1_10Apr2022.pdf
 
Plug yourself in and your app will never be the same (1 hr edition)
Plug yourself in and your app will never be the same (1 hr edition)Plug yourself in and your app will never be the same (1 hr edition)
Plug yourself in and your app will never be the same (1 hr edition)
 
Selenium IDE
Selenium IDESelenium IDE
Selenium IDE
 
Selenium IDE
Selenium IDESelenium IDE
Selenium IDE
 
Selenium tutorial
Selenium tutorialSelenium tutorial
Selenium tutorial
 
Code Camp - Presentation - Windows 10 - (Cortana)
Code Camp - Presentation - Windows 10 - (Cortana)Code Camp - Presentation - Windows 10 - (Cortana)
Code Camp - Presentation - Windows 10 - (Cortana)
 
Plug-in Architectures
Plug-in ArchitecturesPlug-in Architectures
Plug-in Architectures
 
Selenium.ppt
Selenium.pptSelenium.ppt
Selenium.ppt
 
Selenium Open Source Tool
Selenium Open Source ToolSelenium Open Source Tool
Selenium Open Source Tool
 

More from Fiyaz Hasan

Up & Running with Polymer
Up & Running with PolymerUp & Running with Polymer
Up & Running with PolymerFiyaz Hasan
 
Preventing XSRF in ASP.NET CORE apps
Preventing XSRF in ASP.NET CORE appsPreventing XSRF in ASP.NET CORE apps
Preventing XSRF in ASP.NET CORE appsFiyaz Hasan
 
Azure push notification hub
Azure push notification hubAzure push notification hub
Azure push notification hubFiyaz Hasan
 
What’s new in C# 6
What’s new in C# 6What’s new in C# 6
What’s new in C# 6Fiyaz Hasan
 
Tales of Two Brothers
Tales of Two BrothersTales of Two Brothers
Tales of Two BrothersFiyaz Hasan
 
When You Cant Code You Can Blend
When You Cant Code You Can BlendWhen You Cant Code You Can Blend
When You Cant Code You Can BlendFiyaz Hasan
 
Walk in the shoe of angular
Walk in the shoe of angularWalk in the shoe of angular
Walk in the shoe of angularFiyaz Hasan
 
Building Windows Phone Database App Using MVVM Pattern
Building Windows Phone Database App Using MVVM PatternBuilding Windows Phone Database App Using MVVM Pattern
Building Windows Phone Database App Using MVVM PatternFiyaz Hasan
 
Play With Windows Phone Local Database
Play With Windows Phone Local DatabasePlay With Windows Phone Local Database
Play With Windows Phone Local DatabaseFiyaz Hasan
 

More from Fiyaz Hasan (9)

Up & Running with Polymer
Up & Running with PolymerUp & Running with Polymer
Up & Running with Polymer
 
Preventing XSRF in ASP.NET CORE apps
Preventing XSRF in ASP.NET CORE appsPreventing XSRF in ASP.NET CORE apps
Preventing XSRF in ASP.NET CORE apps
 
Azure push notification hub
Azure push notification hubAzure push notification hub
Azure push notification hub
 
What’s new in C# 6
What’s new in C# 6What’s new in C# 6
What’s new in C# 6
 
Tales of Two Brothers
Tales of Two BrothersTales of Two Brothers
Tales of Two Brothers
 
When You Cant Code You Can Blend
When You Cant Code You Can BlendWhen You Cant Code You Can Blend
When You Cant Code You Can Blend
 
Walk in the shoe of angular
Walk in the shoe of angularWalk in the shoe of angular
Walk in the shoe of angular
 
Building Windows Phone Database App Using MVVM Pattern
Building Windows Phone Database App Using MVVM PatternBuilding Windows Phone Database App Using MVVM Pattern
Building Windows Phone Database App Using MVVM Pattern
 
Play With Windows Phone Local Database
Play With Windows Phone Local DatabasePlay With Windows Phone Local Database
Play With Windows Phone Local Database
 

Recently uploaded

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 

Recently uploaded (20)

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 

Hands free with cortana

  • 2. “ I’m Fiyaz Hasan #Versatile #Tech #Developer I’m a .NET and JavaScript enthusiast. I like to work with different technologies on different platforms. I love the logic and structure of coding and always strives to write more elegant and efficient code. I’m passionate about design patterns and applying Software Engineering best practices. www.fiyazhasan.me
  • 3. Hey Cortana, Who am I? You are Fizz
  • 4. Hey Cortana, Who are you? I am Cortana
  • 5. Integrating with Cortana in 3 simple steps Create Voice Command Definition (s) Register VCD on App Startup Handle Voice Command Activation
  • 7. Step 1 <?xml version="1.0" encoding="utf-8"?> <VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2"> <CommandSet xml:lang="en-us" Name="MySimpleTodoCommandSet_en-us"> <CommandPrefix> My Simple To do </CommandPrefix> <Example> pending tasks </Example> <Command Name="todoBackgroundCommandList"> <Example> pending tasks </Example> <ListenFor> {command} task[s] </ListenFor> <Feedback> Executing specific command </Feedback> <VoiceCommandService Target="SimpleTodoVoiceCommandService"/> </Command> <PhraseTopic Label="command" Scenario="Search"> <Subject> pending </Subject> </PhraseTopic> </CommandSet> </VoiceCommands> Create Voice Command Definition(s) Note: the VCD is identical for JavaScript and C# apps
  • 8. <?xml version="1.0" encoding="utf-8"?> <VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2"> <CommandSet xml:lang="en-us" Name="MySimpleTodoCommandSet_en-us"> <CommandPrefix> My Simple To do </CommandPrefix> <Example> pending tasks </Example> <Command Name="todoBackgroundCommandList"> <Example> pending tasks </Example> <ListenFor> {command} task[s] </ListenFor> <Feedback> Executing specific command </Feedback> <VoiceCommandService Target="SimpleTodoVoiceCommandService"/> </Command> <PhraseTopic Label="command" Scenario="Search"> <Subject> pending </Subject> </PhraseTopic> </CommandSet> </VoiceCommands> <CommandPrefix> My Simple To do </CommandPrefix> Step 1
  • 9. <?xml version="1.0" encoding="utf-8"?> <VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2"> <CommandSet xml:lang="en-us" Name="MySimpleTodoCommandSet_en-us"> <CommandPrefix> My Simple To do </CommandPrefix> <Example> pending tasks </Example> <Command Name="todoBackgroundCommandList"> <Example> pending tasks </Example> <ListenFor> {command} task[s] </ListenFor> <Feedback> Executing specific command </Feedback> <VoiceCommandService Target="SimpleTodoVoiceCommandService"/> </Command> <PhraseTopic Label="command" Scenario="Search"> <Subject> pending </Subject> </PhraseTopic> </CommandSet> </VoiceCommands> <Example> pending tasks </Example> Step 1
  • 10. <?xml version="1.0" encoding="utf-8"?> <VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2"> <CommandSet xml:lang="en-us" Name="MySimpleTodoCommandSet_en-us"> <CommandPrefix> My Simple To do </CommandPrefix> <Example> pending tasks </Example> <Command Name="todoBackgroundCommandList"> <Example> pending tasks </Example> <ListenFor> {command} task[s] </ListenFor> <Feedback> Executing specific command </Feedback> <VoiceCommandService Target="SimpleTodoVoiceCommandService"/> </Command> <PhraseTopic Label="command" Scenario="Search"> <Subject> pending </Subject> </PhraseTopic> </CommandSet> </VoiceCommands> <Command Name="todoBackgroundCommandList"> <Example> pending tasks </Example> <ListenFor> {command} task[s] </ListenFor> <Feedback> showing {command} tasks </Feedback> <VoiceCommandService Target="SimpleTodoVoiceCommandService"/> </Command> Step 1
  • 11. <?xml version="1.0" encoding="utf-8"?> <VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2"> <CommandSet xml:lang="en-us" Name="MySimpleTodoCommandSet_en-us"> <CommandPrefix> My Simple To do </CommandPrefix> <Example> pending tasks </Example> <Command Name="todoBackgroundCommandList"> <Example> pending tasks </Example> <ListenFor> {command} task[s] </ListenFor> <Feedback> Executing specific command </Feedback> <VoiceCommandService Target="SimpleTodoVoiceCommandService"/> </Command> <PhraseTopic Label="command" Scenario="Search"> <Subject> pending </Subject> </PhraseTopic> </CommandSet> </VoiceCommands> <Example> pending tasks </Example> Step 1
  • 12. <?xml version="1.0" encoding="utf-8"?> <VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2"> <CommandSet xml:lang="en-us" Name="MySimpleTodoCommandSet_en-us"> <CommandPrefix> My Simple To do </CommandPrefix> <Example> pending tasks </Example> <Command Name="todoBackgroundCommandList"> <Example> pending tasks </Example> <ListenFor> {command} task[s] </ListenFor> <Feedback> Executing specific command </Feedback> <VoiceCommandService Target="SimpleTodoVoiceCommandService"/> </Command> <PhraseTopic Label="command" Scenario="Search"> <Subject> pending </Subject> </PhraseTopic> </CommandSet> </VoiceCommands> <ListenFor> {command} task[s] </ListenFor> Step 1
  • 13. <?xml version="1.0" encoding="utf-8"?> <VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2"> <CommandSet xml:lang="en-us" Name="MySimpleTodoCommandSet_en-us"> <CommandPrefix> My Simple To do </CommandPrefix> <Example> pending tasks </Example> <Command Name="todoBackgroundCommandList"> <Example> pending tasks </Example> <ListenFor> {command} task[s] </ListenFor> <Feedback> Executing specific command </Feedback> <VoiceCommandService Target="SimpleTodoVoiceCommandService"/> </Command> <PhraseTopic Label="command" Scenario="Search"> <Subject> pending </Subject> </PhraseTopic> </CommandSet> </VoiceCommands> <Feedback> Executing specific command </Feedback> Step 1
  • 14. <?xml version="1.0" encoding="utf-8"?> <VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2"> <CommandSet xml:lang="en-us" Name="MySimpleTodoCommandSet_en-us"> <CommandPrefix> My Simple To do </CommandPrefix> <Example> pending tasks </Example> <Command Name="todoBackgroundCommandList"> <Example> pending tasks </Example> <ListenFor> {command} task[s] </ListenFor> <Feedback> Executing specific command </Feedback> <VoiceCommandService Target="SimpleTodoVoiceCommandService"/> </Command> <PhraseTopic Label="command" Scenario="Search"> <Subject> pending </Subject> </PhraseTopic> </CommandSet> </VoiceCommands> <VoiceCommandService Target="SimpleTodoVoiceCommandService"/> Step 1
  • 15. <?xml version="1.0" encoding="utf-8"?> <VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2"> <CommandSet xml:lang="en-us" Name="MySimpleTodoCommandSet_en-us"> <CommandPrefix> My Simple To do </CommandPrefix> <Example> pending tasks </Example> <Command Name="todoBackgroundCommandList"> <Example> pending tasks </Example> <ListenFor> {command} task[s] </ListenFor> <Feedback> Executing specific command </Feedback> <VoiceCommandService Target="SimpleTodoVoiceCommandService"/> </Command> <PhraseTopic Label="command" Scenario="Search"> <Subject> pending </Subject> </PhraseTopic> </CommandSet> </VoiceCommands> <PhraseTopic Label="command" Scenario="Search"> <Subject> pending </Subject> </PhraseTopic> Step 1
  • 16. “ Register VCD XML file on App Startup
  • 17. private async Task RegisterVoiceCommands() { var storageFile = await StorageFile.GetFileFromApplicationUriAsync( new Uri("ms-appx:///MySimpleTodoCommands.xml")); await VoiceCommandDefinitionManager .InstallCommandDefinitionsFromStorageFileAsync(storageFile); } Step 2 Register VCD XML file on App Startup Step 1
  • 19. Step 3 Step 1 Step 2 Handle Voice Command Activation var triggerDetails = taskInstance.TriggerDetails as AppServiceTriggerDetails; if (triggerDetails?.Name == "SimpleTodoVoiceCommandService") { _deferral = taskInstance.GetDeferral(); var cancelledTokenSource = new CancellationTokenSource(); _voiceServiceConnection = VoiceCommandServiceConnection.FromAppServiceTriggerDetails(triggerDetails); var voiceCommand = await _voiceServiceConnection.GetVoiceCommandAsync(); switch (voiceCommand.CommandName) { case "todoBackgroundCommandList": var command = voiceCommand.Properties["command"][0]; if (command == "pending") await (); break; default: (); break; } }