SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Downloaden Sie, um offline zu lesen
WINDOWS PHONE 8
SPEECH: PARLIAMO CON
LA NOSTRA APP
Michele Locuratolo
Nokia Developer Champion
Microsoft MVP
AGENDA
Nuove funzionalità riconoscimento vocale

_1

Uso dei comandi vocali

_2

Riconoscimento vocale e sintesi nelle app

_3
NUOVE FUNZIONALITÀ
RICONOSCIMENTO VOCALE
•

•
•

VoiceCommand: viene gestita a livello di sistma operativo e
permette di interagire con la nostra app dall’esterno (quando l’app
non è in esecuzione
Speech Recognition: è il motore vero e proprio di riconoscimento
vocale, quello che permette di “tradurre” l’input vocale in testo
Text to speech (TTS): è il sintetizzatore vocale. Quello che ci
permette di far “parlare” la nostra applicazione
SCHEMA INTERAZIONE
SCENARI D’USO
•
•
•
•

Aprire un app ad una pagina specifica (“mostrami il meteo di oggi”)
Dettare appunti vocali
Interagire con l’applicazione (“leggimi la nota 5”)
… etc
VOICE COMMAND: STEP BY STEP
1.
2.
3.
4.

Specificare i comandi nel VoiceCommandDefinition
Registrare il file VCD (al primo avvio)
Gestire i comandi all’avvio dell’applicazione
Aggiornare, se necessario, i parametri dinamicamente
VOICE COMMAND OVERVIEW
•
•
•

Da una qualunque schermata sul device, si può pronunciare il nome
dell’applicazione ed il comando da eseguire.
L’app viene lanciata passando il comando ed i parametri in
querystring
Built-UI per feedback, discoverability etc
VOICE COMMAND OVERVIEW
•
•
•
•
•

I comandi sono contenuti nel file VoiceCommandDefinition (VCD)
Supporto per Dynamic Parameter
Supporto per più lingue
Il VCD viene istanziato una sola volta all’avvio dell’applicazione
I parametri possono essere aggiornati dinamicamente
ANATOMIA VCD (STEP 1)
Lingua
Esempio da
mostrare nella
UI

Nome leggibile
con cui aprire
l’app
Comando
Pagina di
destinazione

Parametri
VOICE COMMAND UI
REGISTRAZIONE VCD (STEP 2)
using Windows.Phone.Speech.VoiceCommands;
// Carica il fine VCD App.xaml.cs
private async void Application_Launching(object sender, LaunchingEventArgs e){
try {
// Specificare il path del file
Uri uri = new Uri("ms-appx:///VoiceCommandDefinition.xml");
await VoiceCommandService.InstallCommandSetsFromFileAsync(uri);
}
catch (Exception ex) {
// Gestire l’eccezione
}
}
GESTIONE COMANDI (STEP 3)
private void MainPage_Loaded(object sender, RoutedEventArgs e){
// Was the page launched by voice commands?
if (this.NavigationContext.QueryString.ContainsKey("voiceCommandName")){
string voiceCommandName = this.NavigationContext.QueryString["voiceCommandName"];
switch (voiceCommandName) {
case “ShowNotes":
string noteID = this.NavigationContext.QueryString["num"];
// Mostra la nota selezionata
break;
// altro
default:
// No match
break;
}
}
}
AGGIORNAMENTO PARAMETRI (STEP 5)
// Recupera il commandset
VoiceCommandSet memosVcs =
VoiceCommandService.InstalledCommandSets[“DemoCommandSet”];
// Aggiorna l’elenco dei parametri(any time)
await memosVcs.UpdatePhraseListAsync("num",
new string[] {"1", "2", "3", "4", "5"});

Aggiornamento dinamico per nuovi elementi relativi all’applicazione (ad esempio,
ID delle note, titoli etc)
CAPABILITIES
Required capabilities
ID_CAP_MICROPHONE
ID_CAP_SPEECH_RECOGNITION
DEMO

Nokia Internal Use Only
IN APP DIALOG
•
•
•
•

Sintesi vocale (Text to Speech)
Riconoscimento vocale
Buit-In UI per feedback
«grammatiche» predefinite e custom
DEMO TTS

Nokia Internal Use Only
TTS
private async void playNote_click(object sender, EventArgs e) {
SpeechSynthesizer synth = new SpeechSynthesizer();
await synth.SpeakTextAsync(_selectedNote.Text);
}


TTS
Sintesi vocale di testi normali
Sintesi Speech Synthesis Markup Language (SSML) via
SpeakSsmlAsync
Eventi:

•
•

•
•
•

•

•

SpeechStarted
BookmarkedReached

API per selezionare la voce da usare
http://msdn.microsoft.com/en-us/library/hh361578
DEMO SSML

Nokia Internal Use Only
RICONOSCIMENTO VOCALE
Riconoscimento vocale integrato
Possibilità di utilizzo di custom grammar
Built-in UI personalizzabile (esempio etc)
Result object con

•
•
•

•
•
•
•
•

Alternates
Confidence
Semantics
Etc…
SPEECHRECOGNIZERUI
ListenText

definisce il messaggio da visualizzare nell’interfaccia di riconoscimento vocale (ad
esempio: detta la tua nota)

ExampleText

è il classico testo di esempio da mostrare all’utente

ReadoutEnabled

se impostato a true, il testo riconosciuto verrà riletto dal sistema. E’ molto utile per dare
un feedback all’utente che, molto probabilmente, non stà guardando il display del
dispositivo

ShowConfirmation

mostra l’eventuale conferma di avvenuto riconoscimento. Se impostato a false, il testo
riconosciuto non verrà riletto
SPEECHRECOGNIZERUI
private async void recNote_click(object sender, EventArgs e) {
SpeechRecognizerUI sr = new SpeechRecognizerUI();
sr.Settings.ListenText = "Cosa scrivo?";
sr.Settings.ExampleText = "far vedere la demo";
sr.Settings.ReadoutEnabled = true;
sr.Settings.ShowConfirmation = true;
SpeechRecognitionUIResult result = await sr.RecognizeWithUIAsync();
if (result.ResultStatus == SpeechRecognitionUIStatus.Succeeded) {
tbxNote.Text = result.RecognitionResult.Text;
}
}
CONFIDENCE
•

•
•

Il livello di confidence, accessibile dalla property
result.RecognitionResult.TextConfidence
Può avere i valori High, Medium, Low e Rejected
In caso di confidence != High, possiamo accedere alle alternative
usando il metodo GetAlternates()
DEMO SPEECH
RECOGNITION

Nokia Internal Use Only
SPEECH RECOGNITION GRAMMAR
•
•

•
•
•

•

Set di parole specifiche interne all’applicazione
Limitazione del range di ricerca delle parole
Miglioramento accuratezza
Latenza ridotta
No UI di conferma
Molto usato per comandi come Salva, Annulla etc.
SPEECH RECOGNITION GRAMMAR
2 set predefiniti su Windows Phone
Default: Short message dictation (SMD)
WebSearch

Esempio
myReco.Grammars.AddGrammarFromPredefinedType
("mySearch",SpeechPredefinedGrammar.WebSearc);
CUSTOM GRAMMAR COMANDI
//Istanziamo il sintetizzatore
SpeechSynthesizer synthesizer = new SpeechSynthesizer();
//Definiamo i comandi
SpeechRecognizer recognizerCommand = new SpeechRecognizer();
var command = new[] { "salva", "annulla", "ripeti" };
recognizerCommand.Grammars.AddGrammarFromList("commands", command);
//Richiediamo il comando da eseguire
await synthesizer.SpeakTextAsync("puoi dire salva ripeti o annulla");
SpeechRecognitionResult commandresult = await recognizerCommand.RecognizeAsync();
string commandResultText = commandresult.Text.ToLower();
switch (commandResultText) {
case "salva"
IN-APP DIALOG
•
•

Possiblità di interagire con l’applicazione usando la voce
Merge di comandi e speech recognition
DEMO IN-APP
DIALOG

Nokia Internal Use Only
CONCLUSIONI
•
•
•
•

•

Ricco set di API per riconoscimento vocale
Possibilità di avviare l’applicazione con la
voce
Text to Speech
Riconoscimento vocale
In-App dialog per poter interagire
dinamicamente con l’app
RISORSE
•
•

•

Documentazione ufficiale: http://msdn.microsoft.com/enus/library/windowsphone/develop/jj206958(v=vs.105).aspx
SSML: http://www.w3.org/TR/speech-synthesis/
Lista articoli in italiano: http://www.michelelocuratolo.com/speech-api-inwindows-phone-8-2/

© 2012 Nokia. All rights reserved.
© 2012 Microsoft. All rights reserved.

12/17/2013

Nokia Internal Use Only
Thank you!

© 2012 Nokia. All rights reserved.
© 2012 Microsoft. All rights reserved.

12/17/2013

Nokia Internal Use Only

Weitere ähnliche Inhalte

Ähnlich wie Windows Phone 8 speech: parliamo con la nostra app

Windows phone 8 - Speech API
Windows phone 8 - Speech APIWindows phone 8 - Speech API
Windows phone 8 - Speech APIMassimo Bonanni
 
Universal Store Apps - Mobile day by DotNetCampania
Universal Store Apps - Mobile day by DotNetCampaniaUniversal Store Apps - Mobile day by DotNetCampania
Universal Store Apps - Mobile day by DotNetCampaniaEmanuele Garofalo
 
Sfruttare Cortana e le speech API nelle nostre app
Sfruttare Cortana e le speech API nelle nostre appSfruttare Cortana e le speech API nelle nostre app
Sfruttare Cortana e le speech API nelle nostre appMassimo Bonanni
 
Automated UI testing for iOs and Android mobile apps
Automated UI testing for iOs and Android mobile appsAutomated UI testing for iOs and Android mobile apps
Automated UI testing for iOs and Android mobile appsMassimo Bonanni
 
SFRUTTARE CORTANA E LE SPEECH API NELLE NOSTRE APP
SFRUTTARE CORTANA E LE SPEECH API NELLE NOSTRE APPSFRUTTARE CORTANA E LE SPEECH API NELLE NOSTRE APP
SFRUTTARE CORTANA E LE SPEECH API NELLE NOSTRE APPDotNetCampus
 
Sfruttare cortana e le speech api nelle nostre app
Sfruttare cortana e le speech api nelle nostre appSfruttare cortana e le speech api nelle nostre app
Sfruttare cortana e le speech api nelle nostre appDotNetCampus
 
Introduzione a Node.js
Introduzione a Node.jsIntroduzione a Node.js
Introduzione a Node.jsMichele Capra
 
Win02 bing e windows store apps
Win02   bing e windows store appsWin02   bing e windows store apps
Win02 bing e windows store appsDotNetCampus
 
DotNetCampus 2014 - BING e Windows Store App
DotNetCampus 2014 - BING e Windows Store AppDotNetCampus 2014 - BING e Windows Store App
DotNetCampus 2014 - BING e Windows Store AppMassimo Bonanni
 
Come utilizzare il bot framework
Come utilizzare il bot frameworkCome utilizzare il bot framework
Come utilizzare il bot frameworkAlessio Iafrate
 
Alessio Iafrate - Utilizziamo il Bot Framework per realizzare il nostro primo...
Alessio Iafrate - Utilizziamo il Bot Framework per realizzare il nostro primo...Alessio Iafrate - Utilizziamo il Bot Framework per realizzare il nostro primo...
Alessio Iafrate - Utilizziamo il Bot Framework per realizzare il nostro primo...Codemotion
 
Da A a Bot con un pizzico di Cognitive
Da A a Bot con un pizzico di CognitiveDa A a Bot con un pizzico di Cognitive
Da A a Bot con un pizzico di CognitiveAlessio Iafrate
 
Dominare il codice legacy
Dominare il codice legacyDominare il codice legacy
Dominare il codice legacyTommaso Torti
 
Push Notification, Live Tile e Background Agent
Push Notification, Live Tile e Background AgentPush Notification, Live Tile e Background Agent
Push Notification, Live Tile e Background AgentDomusDotNet
 
Windows Workflow Foundation 4
Windows Workflow Foundation 4Windows Workflow Foundation 4
Windows Workflow Foundation 4Felice Pescatore
 

Ähnlich wie Windows Phone 8 speech: parliamo con la nostra app (20)

Windows phone 8 - Speech API
Windows phone 8 - Speech APIWindows phone 8 - Speech API
Windows phone 8 - Speech API
 
Universal Store Apps - Mobile day by DotNetCampania
Universal Store Apps - Mobile day by DotNetCampaniaUniversal Store Apps - Mobile day by DotNetCampania
Universal Store Apps - Mobile day by DotNetCampania
 
Sfruttare Cortana e le speech API nelle nostre app
Sfruttare Cortana e le speech API nelle nostre appSfruttare Cortana e le speech API nelle nostre app
Sfruttare Cortana e le speech API nelle nostre app
 
Automated UI testing for iOs and Android mobile apps
Automated UI testing for iOs and Android mobile appsAutomated UI testing for iOs and Android mobile apps
Automated UI testing for iOs and Android mobile apps
 
SFRUTTARE CORTANA E LE SPEECH API NELLE NOSTRE APP
SFRUTTARE CORTANA E LE SPEECH API NELLE NOSTRE APPSFRUTTARE CORTANA E LE SPEECH API NELLE NOSTRE APP
SFRUTTARE CORTANA E LE SPEECH API NELLE NOSTRE APP
 
Sfruttare cortana e le speech api nelle nostre app
Sfruttare cortana e le speech api nelle nostre appSfruttare cortana e le speech api nelle nostre app
Sfruttare cortana e le speech api nelle nostre app
 
#dd12 Applicazioni a tre voci (Android e Domino)
#dd12 Applicazioni a tre voci (Android e Domino)#dd12 Applicazioni a tre voci (Android e Domino)
#dd12 Applicazioni a tre voci (Android e Domino)
 
Introduzione a node.js
Introduzione a node.jsIntroduzione a node.js
Introduzione a node.js
 
Introduzione a Node.js
Introduzione a Node.jsIntroduzione a Node.js
Introduzione a Node.js
 
Unit testing 101
Unit testing 101Unit testing 101
Unit testing 101
 
Win02 bing e windows store apps
Win02   bing e windows store appsWin02   bing e windows store apps
Win02 bing e windows store apps
 
DotNetCampus 2014 - BING e Windows Store App
DotNetCampus 2014 - BING e Windows Store AppDotNetCampus 2014 - BING e Windows Store App
DotNetCampus 2014 - BING e Windows Store App
 
Come utilizzare il bot framework
Come utilizzare il bot frameworkCome utilizzare il bot framework
Come utilizzare il bot framework
 
Alessio Iafrate - Utilizziamo il Bot Framework per realizzare il nostro primo...
Alessio Iafrate - Utilizziamo il Bot Framework per realizzare il nostro primo...Alessio Iafrate - Utilizziamo il Bot Framework per realizzare il nostro primo...
Alessio Iafrate - Utilizziamo il Bot Framework per realizzare il nostro primo...
 
Da A a Bot con un pizzico di Cognitive
Da A a Bot con un pizzico di CognitiveDa A a Bot con un pizzico di Cognitive
Da A a Bot con un pizzico di Cognitive
 
#dd12 grillo daniele_xpages_tips_tricks_rev2
#dd12 grillo daniele_xpages_tips_tricks_rev2#dd12 grillo daniele_xpages_tips_tricks_rev2
#dd12 grillo daniele_xpages_tips_tricks_rev2
 
Dominare il codice legacy
Dominare il codice legacyDominare il codice legacy
Dominare il codice legacy
 
Push Notification, Live Tile e Background Agent
Push Notification, Live Tile e Background AgentPush Notification, Live Tile e Background Agent
Push Notification, Live Tile e Background Agent
 
Xamarin Test Cloud
Xamarin Test CloudXamarin Test Cloud
Xamarin Test Cloud
 
Windows Workflow Foundation 4
Windows Workflow Foundation 4Windows Workflow Foundation 4
Windows Workflow Foundation 4
 

Mehr von Microsoft Mobile Developer

Intro to Nokia X software platform 2.0 and tools
Intro to Nokia X software platform 2.0 and toolsIntro to Nokia X software platform 2.0 and tools
Intro to Nokia X software platform 2.0 and toolsMicrosoft Mobile Developer
 
Location based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tagLocation based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tagMicrosoft Mobile Developer
 
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultations
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultationsLumia App Labs: Lessons learned from 50 windows phone 8 design consultations
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultationsMicrosoft Mobile Developer
 
La pubblicazione di un'applicazione sullo store
La pubblicazione di un'applicazione sullo storeLa pubblicazione di un'applicazione sullo store
La pubblicazione di un'applicazione sullo storeMicrosoft Mobile Developer
 
Il pattern mvvm come strutturare al meglio il vostro progetto
Il pattern mvvm come strutturare al meglio il vostro progettoIl pattern mvvm come strutturare al meglio il vostro progetto
Il pattern mvvm come strutturare al meglio il vostro progettoMicrosoft Mobile Developer
 
Lens app trasformare il telefono in una fotocamera
Lens app trasformare il telefono in una fotocameraLens app trasformare il telefono in una fotocamera
Lens app trasformare il telefono in una fotocameraMicrosoft Mobile Developer
 

Mehr von Microsoft Mobile Developer (20)

Intro to Nokia X software platform 2.0 and tools
Intro to Nokia X software platform 2.0 and toolsIntro to Nokia X software platform 2.0 and tools
Intro to Nokia X software platform 2.0 and tools
 
Lumia App Labs: Lumia SensorCore SDK beta
Lumia App Labs: Lumia SensorCore SDK betaLumia App Labs: Lumia SensorCore SDK beta
Lumia App Labs: Lumia SensorCore SDK beta
 
Nokia Asha from idea to app - Imaging
Nokia Asha from idea to app - ImagingNokia Asha from idea to app - Imaging
Nokia Asha from idea to app - Imaging
 
Healthcare apps for Nokia X and Nokia Asha
Healthcare apps for Nokia X and Nokia AshaHealthcare apps for Nokia X and Nokia Asha
Healthcare apps for Nokia X and Nokia Asha
 
Push notifications on Nokia X
Push notifications on Nokia XPush notifications on Nokia X
Push notifications on Nokia X
 
DIY Nokia Asha app usability studies
DIY Nokia Asha app usability studiesDIY Nokia Asha app usability studies
DIY Nokia Asha app usability studies
 
Lessons learned from Nokia X UI reviews
Lessons learned from Nokia X UI reviewsLessons learned from Nokia X UI reviews
Lessons learned from Nokia X UI reviews
 
Location based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tagLocation based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tag
 
HERE Maps for the Nokia X platform
HERE Maps for the Nokia X platformHERE Maps for the Nokia X platform
HERE Maps for the Nokia X platform
 
Nokia In-App Payment - UX considerations
Nokia In-App Payment - UX considerationsNokia In-App Payment - UX considerations
Nokia In-App Payment - UX considerations
 
Introduction to Nokia Asha SDK 1.2 (beta)
Introduction to Nokia Asha SDK 1.2 (beta)Introduction to Nokia Asha SDK 1.2 (beta)
Introduction to Nokia Asha SDK 1.2 (beta)
 
UX considerations when porting to Nokia X
UX considerations when porting to Nokia XUX considerations when porting to Nokia X
UX considerations when porting to Nokia X
 
Kids' games and educational app design
Kids' games and educational app designKids' games and educational app design
Kids' games and educational app design
 
Nokia X: opportunities for developers
Nokia X: opportunities for developersNokia X: opportunities for developers
Nokia X: opportunities for developers
 
Lumia App Labs: Nokia Imaging SDK 1.1
Lumia App Labs: Nokia Imaging SDK 1.1Lumia App Labs: Nokia Imaging SDK 1.1
Lumia App Labs: Nokia Imaging SDK 1.1
 
Intro to Nokia X software platform and tools
Intro to Nokia X software platform and toolsIntro to Nokia X software platform and tools
Intro to Nokia X software platform and tools
 
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultations
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultationsLumia App Labs: Lessons learned from 50 windows phone 8 design consultations
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultations
 
La pubblicazione di un'applicazione sullo store
La pubblicazione di un'applicazione sullo storeLa pubblicazione di un'applicazione sullo store
La pubblicazione di un'applicazione sullo store
 
Il pattern mvvm come strutturare al meglio il vostro progetto
Il pattern mvvm come strutturare al meglio il vostro progettoIl pattern mvvm come strutturare al meglio il vostro progetto
Il pattern mvvm come strutturare al meglio il vostro progetto
 
Lens app trasformare il telefono in una fotocamera
Lens app trasformare il telefono in una fotocameraLens app trasformare il telefono in una fotocamera
Lens app trasformare il telefono in una fotocamera
 

Kürzlich hochgeladen

Gabriele Mittica, CEO @Corley Cloud – “Come creare un’azienda “nativa in clou...
Gabriele Mittica, CEO @Corley Cloud – “Come creare un’azienda “nativa in clou...Gabriele Mittica, CEO @Corley Cloud – “Come creare un’azienda “nativa in clou...
Gabriele Mittica, CEO @Corley Cloud – “Come creare un’azienda “nativa in clou...Associazione Digital Days
 
Daniele Lunassi, CEO & Head of Design @Eye Studios – “Creare prodotti e servi...
Daniele Lunassi, CEO & Head of Design @Eye Studios – “Creare prodotti e servi...Daniele Lunassi, CEO & Head of Design @Eye Studios – “Creare prodotti e servi...
Daniele Lunassi, CEO & Head of Design @Eye Studios – “Creare prodotti e servi...Associazione Digital Days
 
Mael Chiabrera, Software Developer; Viola Bongini, Digital Experience Designe...
Mael Chiabrera, Software Developer; Viola Bongini, Digital Experience Designe...Mael Chiabrera, Software Developer; Viola Bongini, Digital Experience Designe...
Mael Chiabrera, Software Developer; Viola Bongini, Digital Experience Designe...Associazione Digital Days
 
Luigi Di Carlo, CEO & Founder @Evometrika srl – “Ruolo della computer vision ...
Luigi Di Carlo, CEO & Founder @Evometrika srl – “Ruolo della computer vision ...Luigi Di Carlo, CEO & Founder @Evometrika srl – “Ruolo della computer vision ...
Luigi Di Carlo, CEO & Founder @Evometrika srl – “Ruolo della computer vision ...Associazione Digital Days
 
Alessandro Nasi, COO @Djungle Studio – “Cosa delegheresti alla copia di te st...
Alessandro Nasi, COO @Djungle Studio – “Cosa delegheresti alla copia di te st...Alessandro Nasi, COO @Djungle Studio – “Cosa delegheresti alla copia di te st...
Alessandro Nasi, COO @Djungle Studio – “Cosa delegheresti alla copia di te st...Associazione Digital Days
 
Programma Biennale Tecnologia 2024 Torino
Programma Biennale Tecnologia 2024 TorinoProgramma Biennale Tecnologia 2024 Torino
Programma Biennale Tecnologia 2024 TorinoQuotidiano Piemontese
 
Federico Bottino, Lead Venture Builder – “Riflessioni sull’Innovazione: La Cu...
Federico Bottino, Lead Venture Builder – “Riflessioni sull’Innovazione: La Cu...Federico Bottino, Lead Venture Builder – “Riflessioni sull’Innovazione: La Cu...
Federico Bottino, Lead Venture Builder – “Riflessioni sull’Innovazione: La Cu...Associazione Digital Days
 
Edoardo Di Pietro – “Virtual Influencer vs Umano: Rubiamo il lavoro all’AI”
Edoardo Di Pietro – “Virtual Influencer vs Umano: Rubiamo il lavoro all’AI”Edoardo Di Pietro – “Virtual Influencer vs Umano: Rubiamo il lavoro all’AI”
Edoardo Di Pietro – “Virtual Influencer vs Umano: Rubiamo il lavoro all’AI”Associazione Digital Days
 
Alessio Mazzotti, Aaron Brancotti; Writer, Screenwriter, Director, UX, Autore...
Alessio Mazzotti, Aaron Brancotti; Writer, Screenwriter, Director, UX, Autore...Alessio Mazzotti, Aaron Brancotti; Writer, Screenwriter, Director, UX, Autore...
Alessio Mazzotti, Aaron Brancotti; Writer, Screenwriter, Director, UX, Autore...Associazione Digital Days
 

Kürzlich hochgeladen (9)

Gabriele Mittica, CEO @Corley Cloud – “Come creare un’azienda “nativa in clou...
Gabriele Mittica, CEO @Corley Cloud – “Come creare un’azienda “nativa in clou...Gabriele Mittica, CEO @Corley Cloud – “Come creare un’azienda “nativa in clou...
Gabriele Mittica, CEO @Corley Cloud – “Come creare un’azienda “nativa in clou...
 
Daniele Lunassi, CEO & Head of Design @Eye Studios – “Creare prodotti e servi...
Daniele Lunassi, CEO & Head of Design @Eye Studios – “Creare prodotti e servi...Daniele Lunassi, CEO & Head of Design @Eye Studios – “Creare prodotti e servi...
Daniele Lunassi, CEO & Head of Design @Eye Studios – “Creare prodotti e servi...
 
Mael Chiabrera, Software Developer; Viola Bongini, Digital Experience Designe...
Mael Chiabrera, Software Developer; Viola Bongini, Digital Experience Designe...Mael Chiabrera, Software Developer; Viola Bongini, Digital Experience Designe...
Mael Chiabrera, Software Developer; Viola Bongini, Digital Experience Designe...
 
Luigi Di Carlo, CEO & Founder @Evometrika srl – “Ruolo della computer vision ...
Luigi Di Carlo, CEO & Founder @Evometrika srl – “Ruolo della computer vision ...Luigi Di Carlo, CEO & Founder @Evometrika srl – “Ruolo della computer vision ...
Luigi Di Carlo, CEO & Founder @Evometrika srl – “Ruolo della computer vision ...
 
Alessandro Nasi, COO @Djungle Studio – “Cosa delegheresti alla copia di te st...
Alessandro Nasi, COO @Djungle Studio – “Cosa delegheresti alla copia di te st...Alessandro Nasi, COO @Djungle Studio – “Cosa delegheresti alla copia di te st...
Alessandro Nasi, COO @Djungle Studio – “Cosa delegheresti alla copia di te st...
 
Programma Biennale Tecnologia 2024 Torino
Programma Biennale Tecnologia 2024 TorinoProgramma Biennale Tecnologia 2024 Torino
Programma Biennale Tecnologia 2024 Torino
 
Federico Bottino, Lead Venture Builder – “Riflessioni sull’Innovazione: La Cu...
Federico Bottino, Lead Venture Builder – “Riflessioni sull’Innovazione: La Cu...Federico Bottino, Lead Venture Builder – “Riflessioni sull’Innovazione: La Cu...
Federico Bottino, Lead Venture Builder – “Riflessioni sull’Innovazione: La Cu...
 
Edoardo Di Pietro – “Virtual Influencer vs Umano: Rubiamo il lavoro all’AI”
Edoardo Di Pietro – “Virtual Influencer vs Umano: Rubiamo il lavoro all’AI”Edoardo Di Pietro – “Virtual Influencer vs Umano: Rubiamo il lavoro all’AI”
Edoardo Di Pietro – “Virtual Influencer vs Umano: Rubiamo il lavoro all’AI”
 
Alessio Mazzotti, Aaron Brancotti; Writer, Screenwriter, Director, UX, Autore...
Alessio Mazzotti, Aaron Brancotti; Writer, Screenwriter, Director, UX, Autore...Alessio Mazzotti, Aaron Brancotti; Writer, Screenwriter, Director, UX, Autore...
Alessio Mazzotti, Aaron Brancotti; Writer, Screenwriter, Director, UX, Autore...
 

Windows Phone 8 speech: parliamo con la nostra app

  • 1. WINDOWS PHONE 8 SPEECH: PARLIAMO CON LA NOSTRA APP Michele Locuratolo Nokia Developer Champion Microsoft MVP
  • 2. AGENDA Nuove funzionalità riconoscimento vocale _1 Uso dei comandi vocali _2 Riconoscimento vocale e sintesi nelle app _3
  • 3. NUOVE FUNZIONALITÀ RICONOSCIMENTO VOCALE • • • VoiceCommand: viene gestita a livello di sistma operativo e permette di interagire con la nostra app dall’esterno (quando l’app non è in esecuzione Speech Recognition: è il motore vero e proprio di riconoscimento vocale, quello che permette di “tradurre” l’input vocale in testo Text to speech (TTS): è il sintetizzatore vocale. Quello che ci permette di far “parlare” la nostra applicazione
  • 5. SCENARI D’USO • • • • Aprire un app ad una pagina specifica (“mostrami il meteo di oggi”) Dettare appunti vocali Interagire con l’applicazione (“leggimi la nota 5”) … etc
  • 6. VOICE COMMAND: STEP BY STEP 1. 2. 3. 4. Specificare i comandi nel VoiceCommandDefinition Registrare il file VCD (al primo avvio) Gestire i comandi all’avvio dell’applicazione Aggiornare, se necessario, i parametri dinamicamente
  • 7. VOICE COMMAND OVERVIEW • • • Da una qualunque schermata sul device, si può pronunciare il nome dell’applicazione ed il comando da eseguire. L’app viene lanciata passando il comando ed i parametri in querystring Built-UI per feedback, discoverability etc
  • 8. VOICE COMMAND OVERVIEW • • • • • I comandi sono contenuti nel file VoiceCommandDefinition (VCD) Supporto per Dynamic Parameter Supporto per più lingue Il VCD viene istanziato una sola volta all’avvio dell’applicazione I parametri possono essere aggiornati dinamicamente
  • 9. ANATOMIA VCD (STEP 1) Lingua Esempio da mostrare nella UI Nome leggibile con cui aprire l’app Comando Pagina di destinazione Parametri
  • 11. REGISTRAZIONE VCD (STEP 2) using Windows.Phone.Speech.VoiceCommands; // Carica il fine VCD App.xaml.cs private async void Application_Launching(object sender, LaunchingEventArgs e){ try { // Specificare il path del file Uri uri = new Uri("ms-appx:///VoiceCommandDefinition.xml"); await VoiceCommandService.InstallCommandSetsFromFileAsync(uri); } catch (Exception ex) { // Gestire l’eccezione } }
  • 12. GESTIONE COMANDI (STEP 3) private void MainPage_Loaded(object sender, RoutedEventArgs e){ // Was the page launched by voice commands? if (this.NavigationContext.QueryString.ContainsKey("voiceCommandName")){ string voiceCommandName = this.NavigationContext.QueryString["voiceCommandName"]; switch (voiceCommandName) { case “ShowNotes": string noteID = this.NavigationContext.QueryString["num"]; // Mostra la nota selezionata break; // altro default: // No match break; } } }
  • 13. AGGIORNAMENTO PARAMETRI (STEP 5) // Recupera il commandset VoiceCommandSet memosVcs = VoiceCommandService.InstalledCommandSets[“DemoCommandSet”]; // Aggiorna l’elenco dei parametri(any time) await memosVcs.UpdatePhraseListAsync("num", new string[] {"1", "2", "3", "4", "5"}); Aggiornamento dinamico per nuovi elementi relativi all’applicazione (ad esempio, ID delle note, titoli etc)
  • 16. IN APP DIALOG • • • • Sintesi vocale (Text to Speech) Riconoscimento vocale Buit-In UI per feedback «grammatiche» predefinite e custom
  • 18. TTS private async void playNote_click(object sender, EventArgs e) { SpeechSynthesizer synth = new SpeechSynthesizer(); await synth.SpeakTextAsync(_selectedNote.Text); } 
  • 19. TTS Sintesi vocale di testi normali Sintesi Speech Synthesis Markup Language (SSML) via SpeakSsmlAsync Eventi: • • • • • • • SpeechStarted BookmarkedReached API per selezionare la voce da usare http://msdn.microsoft.com/en-us/library/hh361578
  • 21. RICONOSCIMENTO VOCALE Riconoscimento vocale integrato Possibilità di utilizzo di custom grammar Built-in UI personalizzabile (esempio etc) Result object con • • • • • • • • Alternates Confidence Semantics Etc…
  • 22. SPEECHRECOGNIZERUI ListenText definisce il messaggio da visualizzare nell’interfaccia di riconoscimento vocale (ad esempio: detta la tua nota) ExampleText è il classico testo di esempio da mostrare all’utente ReadoutEnabled se impostato a true, il testo riconosciuto verrà riletto dal sistema. E’ molto utile per dare un feedback all’utente che, molto probabilmente, non stà guardando il display del dispositivo ShowConfirmation mostra l’eventuale conferma di avvenuto riconoscimento. Se impostato a false, il testo riconosciuto non verrà riletto
  • 23. SPEECHRECOGNIZERUI private async void recNote_click(object sender, EventArgs e) { SpeechRecognizerUI sr = new SpeechRecognizerUI(); sr.Settings.ListenText = "Cosa scrivo?"; sr.Settings.ExampleText = "far vedere la demo"; sr.Settings.ReadoutEnabled = true; sr.Settings.ShowConfirmation = true; SpeechRecognitionUIResult result = await sr.RecognizeWithUIAsync(); if (result.ResultStatus == SpeechRecognitionUIStatus.Succeeded) { tbxNote.Text = result.RecognitionResult.Text; } }
  • 24. CONFIDENCE • • • Il livello di confidence, accessibile dalla property result.RecognitionResult.TextConfidence Può avere i valori High, Medium, Low e Rejected In caso di confidence != High, possiamo accedere alle alternative usando il metodo GetAlternates()
  • 26. SPEECH RECOGNITION GRAMMAR • • • • • • Set di parole specifiche interne all’applicazione Limitazione del range di ricerca delle parole Miglioramento accuratezza Latenza ridotta No UI di conferma Molto usato per comandi come Salva, Annulla etc.
  • 27. SPEECH RECOGNITION GRAMMAR 2 set predefiniti su Windows Phone Default: Short message dictation (SMD) WebSearch Esempio myReco.Grammars.AddGrammarFromPredefinedType ("mySearch",SpeechPredefinedGrammar.WebSearc);
  • 28. CUSTOM GRAMMAR COMANDI //Istanziamo il sintetizzatore SpeechSynthesizer synthesizer = new SpeechSynthesizer(); //Definiamo i comandi SpeechRecognizer recognizerCommand = new SpeechRecognizer(); var command = new[] { "salva", "annulla", "ripeti" }; recognizerCommand.Grammars.AddGrammarFromList("commands", command); //Richiediamo il comando da eseguire await synthesizer.SpeakTextAsync("puoi dire salva ripeti o annulla"); SpeechRecognitionResult commandresult = await recognizerCommand.RecognizeAsync(); string commandResultText = commandresult.Text.ToLower(); switch (commandResultText) { case "salva"
  • 29. IN-APP DIALOG • • Possiblità di interagire con l’applicazione usando la voce Merge di comandi e speech recognition
  • 31. CONCLUSIONI • • • • • Ricco set di API per riconoscimento vocale Possibilità di avviare l’applicazione con la voce Text to Speech Riconoscimento vocale In-App dialog per poter interagire dinamicamente con l’app
  • 32. RISORSE • • • Documentazione ufficiale: http://msdn.microsoft.com/enus/library/windowsphone/develop/jj206958(v=vs.105).aspx SSML: http://www.w3.org/TR/speech-synthesis/ Lista articoli in italiano: http://www.michelelocuratolo.com/speech-api-inwindows-phone-8-2/ © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved. 12/17/2013 Nokia Internal Use Only
  • 33. Thank you! © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved. 12/17/2013 Nokia Internal Use Only