1. Voice APIs in
Windows Phone 8
Josué Yeray Julián Ferreiro
Development advisor @ Plain Concepts
Nokia Developer Champion / Certified Trainer
Microsoft MVP Windows Phone
josueyeray@gmail.com
@JosueYeray
http://bit.ly/BlogYeray
1
2. Voice APIs in Windows Phone 8
Windows Phone 8 Incluye tres tipos de uso de voz
• Comandos de voz (VCD)
• Text To Speech (TTS)
• Speech To Text (STT)
3. Voice APIs in Windows Phone 8
Comandos de Voz
Nos permiten definir ordenes, que el sistema operativo entiende
Sirven para iniciar nuestra aplicación, realizando una acción concreta
Manejados por el sistema:
Definimos un archivo VCD
Al inicio de la app, lo instalamos en el sistema
El sistema será capaz de ejecutar esas ordenes
4. Voice APIs in Windows Phone 8
Comandos de Voz
Archivo VCD (Voice Command Definition)
Compuesto por CommandSets, cada uno con un idioma
Cada CommandSet se compone de comandos
<CommandSet xml:lang="es" Name="NavigatorSpanishCommands">
<CommandPrefix>navegador</CommandPrefix>
<Example> abrir navegador </Example>
<Command Name="SeachNavigator">
<Example> nueva ruta </Example>
<ListenFor> [y] buscar [una] [nueva] ruta </ListenFor>
<Feedback> buscando nueva ruta... </Feedback>
<Navigate />
</Command>
</CommandSet>
5. Voice APIs in Windows Phone 8
Comandos de Voz
Clase VoiceCommandService
Namespace Windows.Phone.Speech.VoiceCommands
IMPORTANTE: ID_CAP_SPEECH_RECOGNITION
Comprobamos si el comando ya está instalado con InstalledCommandSets
Instalamos con InstallCommandSetFromFileAsync
if (!VoiceCommandService.InstalledCommandSets.ContainsKey("NavigatorEnglishCommands"))
await VoiceCommandService.InstallCommandSetsFromFileAsync(
new Uri("ms-appx:///VoiceCommands.xml", UriKind.Absolute));
6. DEMO TIME!
Añadiendo commandos de voz a nuestro navegador GPS
6
7. Voice APIs in Windows Phone 8
Speech To Text
Nos permite reconocer texto a partir de la voz
Namespace Windows.Phone.Speech.Recognition
Clase SpeechRecognizerUI
IMPORTANTE: ID_CAP_SPEECH_RECOGNITION y ID_CAP_MICROPHONE
8. Voice APIs in Windows Phone 8
Speech To Text (Without UI)
Nos permite reconocer texto a partir de la voz
Namespace Windows.Phone.Speech.Recognition
Clase SpeechRecognizer
Evento AudioCaptureStateChanged
IMPORTANTE: ID_CAP_SPEECH_RECOGNITION y ID_CAP_MICROPHONE
9. DEMO TIME!
Añadiendo reconocimiento de voz a nuestro navegador GPS
9
10. Voice APIs in Windows Phone 8
Text To Speech
Nos permite sintetizar texto con las voces instaladas en el sistema.
Podemos escoger género e idioma de la voz.
Namespace Windows.Phone.Speech.Synthesis
Clase SpeechSynthesizer
SpeechTextAsync(“”);
11. DEMO TIME!
Añadiendo sintetización de voz a nuestro navegador GPS
11
12. Voice APIs in Windows Phone 8
josueyeray@gmail.com
@JosueYeray
http://bit.ly/blogyeray
¡Gracias!
¿Preguntas?