SlideShare a Scribd company logo
Speech for
Windows Phone 8


       Marco Massarelli
    http://ceoloide.com
Speech for Windows Phone 8


1. Voice commands
2. Speech recognition
3. Text-to-speech (TTS)
4. Q&A
11   Voice commands
1   Voice commands

                                YOUR APP

                           SPEECH RECOGNITION

          VOICE COMMANDS
                           TEXT-TO-SPEECH (TTS)




• Application entry point
• Can act as deep links to your application
1    Voice commands
• Set up your project capabilities:
   – D_CAP_SPEECH_RECOGNITION,
   – ID_CAP_MICROPHONE,
   – ID_CAP_NETWORKING

• Create a new Voice Command Definition
1   Voice commands

        <?xml version="1.0" encoding="utf-8"?>
        <VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.0">

           <CommandSet xml:lang="en-us">
                <CommandPrefix> Contoso Widgets </CommandPrefix>
                <Example> Show today's specials </Example>
                <Command Name="showWidgets">
                      <Example> Show today's specials </Example>
                      <ListenFor> [Show] {widgetViews} </ListenFor>
                      <ListenFor> {*} [Show] {widgetViews} </ListenFor>
                      <Feedback> Showing {widgetViews} </Feedback>
                      <Navigate Target="/favorites.xaml"/>
                </Command>
                <PhraseList Label="widgetViews">
                      <Item> today's specials </Item>
                      <Item> best sellers </Item>
                </PhraseList>
           </CommandSet>

           <!-- Other CommandSets for other languages -->

        </VoiceCommands>
1          Voice commands

• Install the Voice Command Definition (VCD) file
  await VoiceCommandService.InstallCommandSetsFromFileAsync( new Uri("ms-appx:///ContosoWidgets.xml") );




• VCD files need to be installed again when a
  backup is restored on a device.
1           Voice commands

• Voice commands parameters are included in the
  QueryString property of the NavigationContext
  "/favorites.xaml?voiceCommandName=showWidgets&widgetViews=best%20sellers&reco=Contoso%20Widgets%Show%20best%20sellers"




• Asterisks in ListenFor phrases are passed as “…”
  – In other words, it is not possible to receive the actual
    text that matched the asterisk.
2
1   Speech recognition
2   Speech recognition

                                YOUR APP

                           SPEECH RECOGNITION

          VOICE COMMANDS
                           TEXT-TO-SPEECH (TTS)




• Natural interaction with your application
• Grammar-based
• Requires internet connection
2    Speech recognition

• Default dictation grammar for free-text
  and web-search are included in WP8
• Custom grammar can be defined in two
  ways:
  – Programmatic list grammar (array of strings)
  – XML grammar leveraging on Speech
    Recognition Grammar Specification (SRGS) 1.0
2         Speech recognition

• Default dictation grammar

  private async void ButtonWeatherSearch_Click(object sender, RoutedEventArgs e)
  {
         // Add the pre-defined web search grammar to the grammar set.
         SpeechRecognizerUI recoWithUI = new SpeechRecognizerUI();

          recoWithUI.Recognizer.Grammars.AddGrammarFromPredefinedType ("weatherSearch",
          SpeechPredefinedGrammar.WebSearch);

          // Display text to prompt the user's input.
          recoWithUI.Settings.ListenText = "Say what you want to search for";

          // Display an example of ideal expected input.
          recoWithUI.Settings.ExampleText = @"Ex. 'weather for London'";

          // Load the grammar set and start recognition.
          SpeechRecognitionUIResult result = await recoWithUI.RecognizeWithUIAsync();
  }
2         Speech recognition

• Programmatic list grammar
  private async void ButtonSR_Click(object sender, RoutedEventArgs e)
  {
         SpeechRecognizerUI recoWithUI = new SpeechRecognizerUI();

          // You can create this string dynamically, for example from a movie queue.
          string[] movies = { "Play The Cleveland Story", "Play The Office", "Play Psych", "Play Breaking
          Bad", "Play Valley of the Sad", "Play Shaking Mad" };

          // Create a grammar from the string array and add it to the grammar set.
          recoWithUI.Recognizer.Grammars.AddGrammarFromList("myMovieList", movies);

          // Display an example of ideal expected input.
          recoWithUI.Settings.ExampleText = @"ex. 'Play New Mocumentaries'";

          // Load the grammar set and start recognition.
          SpeechRecognitionUIResult result = await recoWithUI.RecognizeWithUIAsync();

          // Play movie given in result.Text
  }
2         Speech recognition

• XML grammar
 private async void ButtonSR_Click(object sender, EventArgs e)
 {
        // Initialize objects ahead of time to avoid delays when starting recognition.
        SpeeechRecognizerUI recoWithUI = new SpeechRecognizerUI();

         // Initialize a URI with a path to the SRGS-compliant XML file.
         Uri orderPizza = new Uri("ms-appx:///OrderPizza.grxml", UriKind.Absolute);

         // Add an SRGS-compliant XML grammar to the grammar set.
         recoWithUI.Recognizer.Grammars.AddGrammarFromUri("PizzaGrammar", orderPizza);

         // Preload the grammar set.
         await recoWithUI.Recognizer.PreloadGrammarsAsync();

         // Display text to prompt the user's input.
         recoWithUI.Settings.ListenText = "What kind of pizza do you want?";

         // Display an example of ideal expected input.
         recoWithUI.Settings.ExampleText = "Large combination with Italian sausage";

         SpeechRecognitionUIResult recoResult = await recoWithUI.RecognizeWithUIAsync();
 }
2   Speech recognition
3
2   Text-to-speech
         (TTS)
3    Text-to-speech (TTS)

                                YOUR APP

                           SPEECH RECOGNITION

          VOICE COMMANDS
                           TEXT-TO-SPEECH (TTS)




• Output synthetized speech
• Provide the user with spoken instructions
3   Text-to-speech (TTS)

• TTS requires only the following capability:
  – ID_CAP_SPEECH_RECOGNITION
• TTS can output the following text types:
  – Unformatted text strings
  – Speech Synthesis Markup Language (SSML)
    1.0 strings or XML files
3       Text-to-speech (TTS)
• Outputting unformatted strings is very easy and
  it is also possible to select a voice language:
       // Declare the SpeechSynthesizer object at the class level.
       SpeechSynthesizer synth;

       private async void ButtonSimpleTTS_Click(object sender, RoutedEventArgs e)
       {
              SpeechSynthesizer synth = new SpeechSynthesizer();
              await synth.SpeakTextAsync("You have a meeting with Peter in 15 minutes.");
       }

       private async void SpeakFrench_Click_1(object sender, RoutedEventArgs e)
       {

             synth = new SpeechSynthesizer(); // Query for a voice that speaks French.

             IEnumerable<VoiceInformation> frenchVoices = from voice in InstalledVoices.All
             where voice.Language == "fr-FR" select voice;

             // Set the voice as identified by the query.
             synth.SetVoice(frenchVoices.ElementAt(0));

             // Count in French.
             await synth.SpeakTextAsync("un, deux, trois, quatre");
       }
3         Text-to-speech (TTS)

• SSML 1.0 text can be outputted from string
  or XML files
   // Speaks a string of text with SSML markup.
   private async void SpeakSsml_Click(object sender, RoutedEventArgs e) {
          SpeechSynthesizer synth = new SpeechSynthesizer(); // Build an SSML prompt in a string.
          string ssmlPrompt = "<speak version="1.0" ";
          ssmlPrompt += "xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US">";
          ssmlPrompt += "This voice speaks English. </speak>"; // Speak the SSML prompt.
          await synth.SpeakSsmlAsync(ssmlPrompt);
   }




   // Speaks the content of a standalone SSML file.
   private async void SpeakSsmlFromFile_Click(object sender, RoutedEventArgs e) {
          // Set the path to the SSML-compliant XML file.
          SpeechSynthesizer synth = new SpeechSynthesizer();

         string path = Package.Current.InstalledLocation.Path + "ChangeVoice.ssml";
         Uri changeVoice = new Uri(path, UriKind.Absolute); // Speak the SSML prompt.
         await synth.SpeakSsmlFromUriAsync(changeVoice);
   }
4
3   Q&A
4    Questions & Answers
• Speech for Windows Phone 8 API
  references:
  – http://msdn.microsoft.com/en-
    us/library/windowsphone/develop/jj206958(v
    =vs.105).aspx
Thank you!

More Related Content

What's hot

Shellscripting
ShellscriptingShellscripting
Shellscripting
Narendra Sisodiya
 
Shell & Shell Script
Shell & Shell Script Shell & Shell Script
Shell & Shell Script
Amit Ghosh
 
Linux shell scripting
Linux shell scriptingLinux shell scripting
Linux shell scripting
Mohamed Abubakar Sittik A
 
Shell programming 1.ppt
Shell programming  1.pptShell programming  1.ppt
Shell programming 1.ppt
Kalkey
 
Powershell notes
Powershell notesPowershell notes
Powershell notes
Carlos Amorim
 
Erlang and Elixir
Erlang and ElixirErlang and Elixir
Erlang and Elixir
Krzysztof Marciniak
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
Manav Prasad
 
Penetration testing using python
Penetration testing using pythonPenetration testing using python
Penetration testing using python
Purna Chander K
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
Geeks Anonymes
 
Unix shell scripts
Unix shell scriptsUnix shell scripts
Unix shell scripts
Prakash Lambha
 
Basics of shell programming
Basics of shell programmingBasics of shell programming
Basics of shell programming
Chandan Kumar Rana
 
Quick start bash script
Quick start   bash scriptQuick start   bash script
Quick start bash script
Simon Su
 
SHELL PROGRAMMING
SHELL PROGRAMMINGSHELL PROGRAMMING
SHELL PROGRAMMING
jinal thakrar
 
The Php Life Cycle
The Php Life CycleThe Php Life Cycle
The Php Life Cycle
Xinchen Hui
 
cq_cxf_integration
cq_cxf_integrationcq_cxf_integration
cq_cxf_integration
Ankur Chauhan
 
Unix - Shell Scripts
Unix - Shell ScriptsUnix - Shell Scripts
Unix - Shell Scripts
ananthimurugesan
 
Using Puppet on Linux, Windows, and Mac OSX
Using Puppet on Linux, Windows, and Mac OSXUsing Puppet on Linux, Windows, and Mac OSX
Using Puppet on Linux, Windows, and Mac OSX
Puppet
 
PHP 7 new engine
PHP 7 new enginePHP 7 new engine
PHP 7 new engine
julien pauli
 
How PHP Works ?
How PHP Works ?How PHP Works ?
How PHP Works ?
Ravi Raj
 
Understanding PHP memory
Understanding PHP memoryUnderstanding PHP memory
Understanding PHP memory
julien pauli
 

What's hot (20)

Shellscripting
ShellscriptingShellscripting
Shellscripting
 
Shell & Shell Script
Shell & Shell Script Shell & Shell Script
Shell & Shell Script
 
Linux shell scripting
Linux shell scriptingLinux shell scripting
Linux shell scripting
 
Shell programming 1.ppt
Shell programming  1.pptShell programming  1.ppt
Shell programming 1.ppt
 
Powershell notes
Powershell notesPowershell notes
Powershell notes
 
Erlang and Elixir
Erlang and ElixirErlang and Elixir
Erlang and Elixir
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Penetration testing using python
Penetration testing using pythonPenetration testing using python
Penetration testing using python
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Unix shell scripts
Unix shell scriptsUnix shell scripts
Unix shell scripts
 
Basics of shell programming
Basics of shell programmingBasics of shell programming
Basics of shell programming
 
Quick start bash script
Quick start   bash scriptQuick start   bash script
Quick start bash script
 
SHELL PROGRAMMING
SHELL PROGRAMMINGSHELL PROGRAMMING
SHELL PROGRAMMING
 
The Php Life Cycle
The Php Life CycleThe Php Life Cycle
The Php Life Cycle
 
cq_cxf_integration
cq_cxf_integrationcq_cxf_integration
cq_cxf_integration
 
Unix - Shell Scripts
Unix - Shell ScriptsUnix - Shell Scripts
Unix - Shell Scripts
 
Using Puppet on Linux, Windows, and Mac OSX
Using Puppet on Linux, Windows, and Mac OSXUsing Puppet on Linux, Windows, and Mac OSX
Using Puppet on Linux, Windows, and Mac OSX
 
PHP 7 new engine
PHP 7 new enginePHP 7 new engine
PHP 7 new engine
 
How PHP Works ?
How PHP Works ?How PHP Works ?
How PHP Works ?
 
Understanding PHP memory
Understanding PHP memoryUnderstanding PHP memory
Understanding PHP memory
 

Similar to Speech for Windows Phone 8

Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShell
Boulos Dib
 
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
ClapperboardCinemaPV
 
Monitoring OSGi Applications with the Web Console
Monitoring OSGi Applications with the Web ConsoleMonitoring OSGi Applications with the Web Console
Monitoring OSGi Applications with the Web Console
Adobe
 
Monitoring OSGi Applications with the Web Console
Monitoring OSGi Applications with the Web ConsoleMonitoring OSGi Applications with the Web Console
Monitoring OSGi Applications with the Web Console
Carsten Ziegeler
 
Monitoring OSGi Applications with the Web Console - Carsten Ziegeler
Monitoring OSGi Applications with the Web Console - Carsten ZiegelerMonitoring OSGi Applications with the Web Console - Carsten Ziegeler
Monitoring OSGi Applications with the Web Console - Carsten Ziegeler
mfrancis
 
Networked APIs with swift
Networked APIs with swiftNetworked APIs with swift
Networked APIs with swift
Tim Burks
 
FMS Administration Seminar
FMS Administration SeminarFMS Administration Seminar
FMS Administration Seminar
Yoss Cohen
 
Calabash-android
Calabash-androidCalabash-android
Calabash-android
Adnan8990
 
Php interview-questions and answers
Php interview-questions and answersPhp interview-questions and answers
Php interview-questions and answers
sheibansari
 
Build 2017 - B8092 - Using Microsoft Cognitive Services to bring the power of...
Build 2017 - B8092 - Using Microsoft Cognitive Services to bring the power of...Build 2017 - B8092 - Using Microsoft Cognitive Services to bring the power of...
Build 2017 - B8092 - Using Microsoft Cognitive Services to bring the power of...
Windows Developer
 
Fonctions vocales sous Windows Phone : intégrez votre application à Cortana !
Fonctions vocales sous Windows Phone : intégrez votre application à Cortana !Fonctions vocales sous Windows Phone : intégrez votre application à Cortana !
Fonctions vocales sous Windows Phone : intégrez votre application à Cortana !
Microsoft
 
Posh Devcon2009
Posh Devcon2009Posh Devcon2009
Posh Devcon2009
db82407
 
Text to speech with Google Cloud
Text to speech with Google CloudText to speech with Google Cloud
Text to speech with Google Cloud
Rajarshi Ghosh
 
Flex3中文教程
Flex3中文教程Flex3中文教程
Flex3中文教程
yiditushe
 
Lets have some fun with twilio open tok
Lets have some fun with   twilio open tokLets have some fun with   twilio open tok
Lets have some fun with twilio open tok
mirahman
 
Tml for Objective C
Tml for Objective CTml for Objective C
Tml for Objective C
Michael Berkovich
 
Tml for Laravel
Tml for LaravelTml for Laravel
Tml for Laravel
Michael Berkovich
 
Xelerator software
Xelerator softwareXelerator software
Xelerator software
Arizona State University
 
TDC 2014 - Cortana
TDC 2014 - CortanaTDC 2014 - Cortana
TDC 2014 - Cortana
tmonaco
 
Functional Testing Swing Applications with Frankenstein
Functional Testing Swing Applications with FrankensteinFunctional Testing Swing Applications with Frankenstein
Functional Testing Swing Applications with Frankenstein
vivek_prahlad
 

Similar to Speech for Windows Phone 8 (20)

Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShell
 
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
 
Monitoring OSGi Applications with the Web Console
Monitoring OSGi Applications with the Web ConsoleMonitoring OSGi Applications with the Web Console
Monitoring OSGi Applications with the Web Console
 
Monitoring OSGi Applications with the Web Console
Monitoring OSGi Applications with the Web ConsoleMonitoring OSGi Applications with the Web Console
Monitoring OSGi Applications with the Web Console
 
Monitoring OSGi Applications with the Web Console - Carsten Ziegeler
Monitoring OSGi Applications with the Web Console - Carsten ZiegelerMonitoring OSGi Applications with the Web Console - Carsten Ziegeler
Monitoring OSGi Applications with the Web Console - Carsten Ziegeler
 
Networked APIs with swift
Networked APIs with swiftNetworked APIs with swift
Networked APIs with swift
 
FMS Administration Seminar
FMS Administration SeminarFMS Administration Seminar
FMS Administration Seminar
 
Calabash-android
Calabash-androidCalabash-android
Calabash-android
 
Php interview-questions and answers
Php interview-questions and answersPhp interview-questions and answers
Php interview-questions and answers
 
Build 2017 - B8092 - Using Microsoft Cognitive Services to bring the power of...
Build 2017 - B8092 - Using Microsoft Cognitive Services to bring the power of...Build 2017 - B8092 - Using Microsoft Cognitive Services to bring the power of...
Build 2017 - B8092 - Using Microsoft Cognitive Services to bring the power of...
 
Fonctions vocales sous Windows Phone : intégrez votre application à Cortana !
Fonctions vocales sous Windows Phone : intégrez votre application à Cortana !Fonctions vocales sous Windows Phone : intégrez votre application à Cortana !
Fonctions vocales sous Windows Phone : intégrez votre application à Cortana !
 
Posh Devcon2009
Posh Devcon2009Posh Devcon2009
Posh Devcon2009
 
Text to speech with Google Cloud
Text to speech with Google CloudText to speech with Google Cloud
Text to speech with Google Cloud
 
Flex3中文教程
Flex3中文教程Flex3中文教程
Flex3中文教程
 
Lets have some fun with twilio open tok
Lets have some fun with   twilio open tokLets have some fun with   twilio open tok
Lets have some fun with twilio open tok
 
Tml for Objective C
Tml for Objective CTml for Objective C
Tml for Objective C
 
Tml for Laravel
Tml for LaravelTml for Laravel
Tml for Laravel
 
Xelerator software
Xelerator softwareXelerator software
Xelerator software
 
TDC 2014 - Cortana
TDC 2014 - CortanaTDC 2014 - Cortana
TDC 2014 - Cortana
 
Functional Testing Swing Applications with Frankenstein
Functional Testing Swing Applications with FrankensteinFunctional Testing Swing Applications with Frankenstein
Functional Testing Swing Applications with Frankenstein
 

Recently uploaded

JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
c5vrf27qcz
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Pitangent Analytics & Technology Solutions Pvt. Ltd
 

Recently uploaded (20)

JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
 

Speech for Windows Phone 8

  • 1. Speech for Windows Phone 8 Marco Massarelli http://ceoloide.com
  • 2. Speech for Windows Phone 8 1. Voice commands 2. Speech recognition 3. Text-to-speech (TTS) 4. Q&A
  • 3. 11 Voice commands
  • 4. 1 Voice commands YOUR APP SPEECH RECOGNITION VOICE COMMANDS TEXT-TO-SPEECH (TTS) • Application entry point • Can act as deep links to your application
  • 5. 1 Voice commands • Set up your project capabilities: – D_CAP_SPEECH_RECOGNITION, – ID_CAP_MICROPHONE, – ID_CAP_NETWORKING • Create a new Voice Command Definition
  • 6. 1 Voice commands <?xml version="1.0" encoding="utf-8"?> <VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.0"> <CommandSet xml:lang="en-us"> <CommandPrefix> Contoso Widgets </CommandPrefix> <Example> Show today's specials </Example> <Command Name="showWidgets"> <Example> Show today's specials </Example> <ListenFor> [Show] {widgetViews} </ListenFor> <ListenFor> {*} [Show] {widgetViews} </ListenFor> <Feedback> Showing {widgetViews} </Feedback> <Navigate Target="/favorites.xaml"/> </Command> <PhraseList Label="widgetViews"> <Item> today's specials </Item> <Item> best sellers </Item> </PhraseList> </CommandSet> <!-- Other CommandSets for other languages --> </VoiceCommands>
  • 7. 1 Voice commands • Install the Voice Command Definition (VCD) file await VoiceCommandService.InstallCommandSetsFromFileAsync( new Uri("ms-appx:///ContosoWidgets.xml") ); • VCD files need to be installed again when a backup is restored on a device.
  • 8. 1 Voice commands • Voice commands parameters are included in the QueryString property of the NavigationContext "/favorites.xaml?voiceCommandName=showWidgets&widgetViews=best%20sellers&reco=Contoso%20Widgets%Show%20best%20sellers" • Asterisks in ListenFor phrases are passed as “…” – In other words, it is not possible to receive the actual text that matched the asterisk.
  • 9. 2 1 Speech recognition
  • 10. 2 Speech recognition YOUR APP SPEECH RECOGNITION VOICE COMMANDS TEXT-TO-SPEECH (TTS) • Natural interaction with your application • Grammar-based • Requires internet connection
  • 11. 2 Speech recognition • Default dictation grammar for free-text and web-search are included in WP8 • Custom grammar can be defined in two ways: – Programmatic list grammar (array of strings) – XML grammar leveraging on Speech Recognition Grammar Specification (SRGS) 1.0
  • 12. 2 Speech recognition • Default dictation grammar private async void ButtonWeatherSearch_Click(object sender, RoutedEventArgs e) { // Add the pre-defined web search grammar to the grammar set. SpeechRecognizerUI recoWithUI = new SpeechRecognizerUI(); recoWithUI.Recognizer.Grammars.AddGrammarFromPredefinedType ("weatherSearch", SpeechPredefinedGrammar.WebSearch); // Display text to prompt the user's input. recoWithUI.Settings.ListenText = "Say what you want to search for"; // Display an example of ideal expected input. recoWithUI.Settings.ExampleText = @"Ex. 'weather for London'"; // Load the grammar set and start recognition. SpeechRecognitionUIResult result = await recoWithUI.RecognizeWithUIAsync(); }
  • 13. 2 Speech recognition • Programmatic list grammar private async void ButtonSR_Click(object sender, RoutedEventArgs e) { SpeechRecognizerUI recoWithUI = new SpeechRecognizerUI(); // You can create this string dynamically, for example from a movie queue. string[] movies = { "Play The Cleveland Story", "Play The Office", "Play Psych", "Play Breaking Bad", "Play Valley of the Sad", "Play Shaking Mad" }; // Create a grammar from the string array and add it to the grammar set. recoWithUI.Recognizer.Grammars.AddGrammarFromList("myMovieList", movies); // Display an example of ideal expected input. recoWithUI.Settings.ExampleText = @"ex. 'Play New Mocumentaries'"; // Load the grammar set and start recognition. SpeechRecognitionUIResult result = await recoWithUI.RecognizeWithUIAsync(); // Play movie given in result.Text }
  • 14. 2 Speech recognition • XML grammar private async void ButtonSR_Click(object sender, EventArgs e) { // Initialize objects ahead of time to avoid delays when starting recognition. SpeeechRecognizerUI recoWithUI = new SpeechRecognizerUI(); // Initialize a URI with a path to the SRGS-compliant XML file. Uri orderPizza = new Uri("ms-appx:///OrderPizza.grxml", UriKind.Absolute); // Add an SRGS-compliant XML grammar to the grammar set. recoWithUI.Recognizer.Grammars.AddGrammarFromUri("PizzaGrammar", orderPizza); // Preload the grammar set. await recoWithUI.Recognizer.PreloadGrammarsAsync(); // Display text to prompt the user's input. recoWithUI.Settings.ListenText = "What kind of pizza do you want?"; // Display an example of ideal expected input. recoWithUI.Settings.ExampleText = "Large combination with Italian sausage"; SpeechRecognitionUIResult recoResult = await recoWithUI.RecognizeWithUIAsync(); }
  • 15. 2 Speech recognition
  • 16. 3 2 Text-to-speech (TTS)
  • 17. 3 Text-to-speech (TTS) YOUR APP SPEECH RECOGNITION VOICE COMMANDS TEXT-TO-SPEECH (TTS) • Output synthetized speech • Provide the user with spoken instructions
  • 18. 3 Text-to-speech (TTS) • TTS requires only the following capability: – ID_CAP_SPEECH_RECOGNITION • TTS can output the following text types: – Unformatted text strings – Speech Synthesis Markup Language (SSML) 1.0 strings or XML files
  • 19. 3 Text-to-speech (TTS) • Outputting unformatted strings is very easy and it is also possible to select a voice language: // Declare the SpeechSynthesizer object at the class level. SpeechSynthesizer synth; private async void ButtonSimpleTTS_Click(object sender, RoutedEventArgs e) { SpeechSynthesizer synth = new SpeechSynthesizer(); await synth.SpeakTextAsync("You have a meeting with Peter in 15 minutes."); } private async void SpeakFrench_Click_1(object sender, RoutedEventArgs e) { synth = new SpeechSynthesizer(); // Query for a voice that speaks French. IEnumerable<VoiceInformation> frenchVoices = from voice in InstalledVoices.All where voice.Language == "fr-FR" select voice; // Set the voice as identified by the query. synth.SetVoice(frenchVoices.ElementAt(0)); // Count in French. await synth.SpeakTextAsync("un, deux, trois, quatre"); }
  • 20. 3 Text-to-speech (TTS) • SSML 1.0 text can be outputted from string or XML files // Speaks a string of text with SSML markup. private async void SpeakSsml_Click(object sender, RoutedEventArgs e) { SpeechSynthesizer synth = new SpeechSynthesizer(); // Build an SSML prompt in a string. string ssmlPrompt = "<speak version="1.0" "; ssmlPrompt += "xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US">"; ssmlPrompt += "This voice speaks English. </speak>"; // Speak the SSML prompt. await synth.SpeakSsmlAsync(ssmlPrompt); } // Speaks the content of a standalone SSML file. private async void SpeakSsmlFromFile_Click(object sender, RoutedEventArgs e) { // Set the path to the SSML-compliant XML file. SpeechSynthesizer synth = new SpeechSynthesizer(); string path = Package.Current.InstalledLocation.Path + "ChangeVoice.ssml"; Uri changeVoice = new Uri(path, UriKind.Absolute); // Speak the SSML prompt. await synth.SpeakSsmlFromUriAsync(changeVoice); }
  • 21. 4 3 Q&A
  • 22. 4 Questions & Answers • Speech for Windows Phone 8 API references: – http://msdn.microsoft.com/en- us/library/windowsphone/develop/jj206958(v =vs.105).aspx