SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
2015 Pebble Developer Retreat
Voice on Pebble
Andrew Stapleton, Firmware Engineer
Voice
• Intro
• Basic overview
• Dictation API - Intro
• Dictation API - Example app
• How it works
• Do’s and don’ts with the API
• Development Help
Voice Overview
Microphone
MCU
PDM -> PCM
Speex Encoder
Dictation UI
Recognizer
6
1 2
3
4
5
Examples
• General text input
• Voice notes
• Voice commands (tell your phone what to do)
• Translation tool
• Search/contextual query interface
• Messaging
• Twitter interface
API - The Basics
DictationSession *dictation_session_create(uint32_t buffer_size,

DictationSessionStatusCallback callback,

void *callback_context);




typedef void (*DictationSessionStatusCallback)(DictationSession *session,

DictationSessionStatus status, 

char *transcription,

void *context);




DictationSessionStatus dictation_session_start(DictationSession *session);
Dictation UI Flow
Dictation UI Flow
UI
Started
Speech
ends
User
accepts
User rejects
1 2 3 4
Dictation UI Flow
x4
1
2
3
4
FailureTranscriptionError
FailureSystemAborted
FailureSystemAborted
Dictation UI Flow
1 2 3
FailureConnectivityError FailureDisabled
API - Advanced Usage
void dictation_session_enable_error_dialogs(DictationSession *session,

bool is_enabled);




void dictation_session_enable_confirmation(DictationSession *session,

bool is_enabled);




DictationSessionStatus dictation_session_stop(DictationSession *session);
Dictation UI Flow
• No confirmation dialog
UI
Started
Speech
ends
1 2 3
API - Demo
• Translation tool
• Use dictation session to get text to be translated from user
• Use Google Translate API to translate the text
• Display response in the form of text to user
#define BUFFER_SIZE (512)
static void init(void) {
session = dictation_session_create(BUFFER_SIZE, handle_dictation_result, NULL);
if (!session) {
APP_LOG(APP_LOG_LEVEL_ERROR, "No phone connected, platform is not supported or "
"phone app does not support dictation APIs!");
}
// more initialization
}
static void select_click_handler(ClickRecognizerRef recognizer, void *context) {
dictation_session_start(session);
}
static void handle_dictation_result(DictationSession *session,
DictationSessionStatus status, char *transcription,
void *context) {
if (status == DictationSessionStatusSuccess) {
if (dictation_result) {
free(dictation_result);
}
const char *preamble = "ENG: ";
size_t len = strlen(transcription);
dictation_result = malloc(len + strlen(preamble) + 1);
strcpy(dictation_result, preamble);
strcat(dictation_result, transcription);
text_layer_set_text(q_text_layer, dictation_result);
} else {
// handle errors
}
}
API - Demo
API - Demo
static void init(void) {
session = dictation_session_create(BUFFER_SIZE, handle_dictation_result, NULL);
if (!session) {
APP_LOG(APP_LOG_LEVEL_ERROR, "No phone connected, platform is not supported or "
"phone app does not support dictation APIs!");
}
dictation_session_enable_confirmation(session, false /* is_enabled */);
// more initialization
}
API - Demo
Recognizer
How it Works - Microphone
Microphone
MCU
PDM -> PCM
Speex Encoder
Dictation UI6
1 2
3
4
5
How it Works - Microphone
• Single, MEMS (microelectromechanical system) microphone
• PDM output @ ~1MHz
•Pulse Density Modulation
•1 bit signal that encodes 16-bit data
• Pass 1 bit signal through decimation and low pass filter to
convert to 16-bit PCM (Pulse code modulation) data at 16kHz
Decimation
+ LPF
Recognizer
How it Works - Encoder
Microphone
MCU
PDM -> PCM
Speex Encoder
Dictation UI6
1 2
3
4
5
How it Works - Encoder
• Why encode?
•Bluetooth throughput limited
• Why Speex?
•Developed specifically for voice encoding
•Outperforms most telephony codecs (compression ratio v
quality)
•Tunable quality
•Recovers from dropped frames
How it Works - Encoder
• CELP (Code-excited linear prediction) coding
• Converts PCM to a sequence of frames
• Converts 16kHz, 16-bit PCM signal (256kbps) to a 12.8kbps
sequence of frames
• ~50% CPU cost
How it Works - The rest
Microphone
MCU
PDM -> PCM
Speex Encoder
Dictation UI6
1 2
3
4
5
Recognizer
Do’s and Don’ts
• Only create one session instance (~1.5kB RAM + buffer space)
- it can be reused.
• While session is in progress:
•No heavy processing
•No appmessage
• Clean up the session to recover precious RAM
• If you decide to disable error messages, provide some useful
feedback for the user.
Do’s and Don’ts
• Common failures:
•user not speaking clearly (helps to enunciate and 

speak slowly)
•background noise.
• Encourage users to keep phrases brief
• Voice language setting may be different from 

watch language
Development Tools
• Dictation API works in local emulator!
• Coming to CloudPebble soon!
• To use with the emulator:
•Fire up the emulator
•With the pebble tool:
•Use voice-enabled app like you would on a watch
$	
  pebble	
  transcribe	
  <status	
  code>	
  -­‐t	
  <transcription	
  string>	
  
$	
  pebble	
  transcribe	
  0	
  -­‐t	
  “What	
  is	
  the	
  current	
  time	
  in	
  London	
  England"
More Info
• API Documentation: http://developer.getpebble.com/docs/c/
preview/Foundation/Dictation/
• Guide: https://developer.getpebble.com/guides/pebble-
apps/sensors/dictation/
• Example: https://github.com/pebble-hacks/voice-demo
Questions?

Contenu connexe

Tendances

GildaVM: a Non-Blocking I/O Architecture for the Cog VM
GildaVM: a Non-Blocking I/O Architecture for the Cog VMGildaVM: a Non-Blocking I/O Architecture for the Cog VM
GildaVM: a Non-Blocking I/O Architecture for the Cog VMESUG
 
Pc based wire less data aquisition system using rf(1)
Pc based wire less data aquisition system using rf(1)Pc based wire less data aquisition system using rf(1)
Pc based wire less data aquisition system using rf(1)Vishalya Dulam
 
LCA14: LCA14-418: Testing a secure framework
LCA14: LCA14-418: Testing a secure frameworkLCA14: LCA14-418: Testing a secure framework
LCA14: LCA14-418: Testing a secure frameworkLinaro
 
Matrix vision presentation
Matrix vision presentationMatrix vision presentation
Matrix vision presentationmatrixtelesol
 
Delta ia plc-dvp_tp_c_en_20160922
Delta ia plc-dvp_tp_c_en_20160922Delta ia plc-dvp_tp_c_en_20160922
Delta ia plc-dvp_tp_c_en_20160922truongnhan1985
 
LCU14 500 ARM Trusted Firmware
LCU14 500 ARM Trusted FirmwareLCU14 500 ARM Trusted Firmware
LCU14 500 ARM Trusted FirmwareLinaro
 
LCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted FirmwareLCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted FirmwareLinaro
 
LAS16-400K2: TianoCore – Open Source UEFI Community Update
LAS16-400K2: TianoCore – Open Source UEFI Community UpdateLAS16-400K2: TianoCore – Open Source UEFI Community Update
LAS16-400K2: TianoCore – Open Source UEFI Community UpdateLinaro
 
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3Linaro
 
HKG18-212 - Trusted Firmware M: Introduction
HKG18-212 - Trusted Firmware M: IntroductionHKG18-212 - Trusted Firmware M: Introduction
HKG18-212 - Trusted Firmware M: IntroductionLinaro
 
Trusted firmware deep_dive_v1.0_
Trusted firmware deep_dive_v1.0_Trusted firmware deep_dive_v1.0_
Trusted firmware deep_dive_v1.0_Linaro
 
Lcu14 306 - OP-TEE Future Enhancements
Lcu14 306 - OP-TEE Future EnhancementsLcu14 306 - OP-TEE Future Enhancements
Lcu14 306 - OP-TEE Future EnhancementsLinaro
 
LCA2018 Open Hardware MiniConference: LoliBot Software
LCA2018 Open Hardware MiniConference: LoliBot SoftwareLCA2018 Open Hardware MiniConference: LoliBot Software
LCA2018 Open Hardware MiniConference: LoliBot SoftwareAndy Gelme
 
20111130 hardware-monitoring-with-the-new-ipmi-plugin-v2
20111130 hardware-monitoring-with-the-new-ipmi-plugin-v220111130 hardware-monitoring-with-the-new-ipmi-plugin-v2
20111130 hardware-monitoring-with-the-new-ipmi-plugin-v2Werner Fischer
 
Q2.12: Power Management Across OSs
Q2.12: Power Management Across OSsQ2.12: Power Management Across OSs
Q2.12: Power Management Across OSsLinaro
 
[Wroclaw #3] Trusted Computing
[Wroclaw #3] Trusted Computing[Wroclaw #3] Trusted Computing
[Wroclaw #3] Trusted ComputingOWASP
 

Tendances (20)

GildaVM: a Non-Blocking I/O Architecture for the Cog VM
GildaVM: a Non-Blocking I/O Architecture for the Cog VMGildaVM: a Non-Blocking I/O Architecture for the Cog VM
GildaVM: a Non-Blocking I/O Architecture for the Cog VM
 
Pc based wire less data aquisition system using rf(1)
Pc based wire less data aquisition system using rf(1)Pc based wire less data aquisition system using rf(1)
Pc based wire less data aquisition system using rf(1)
 
LCA14: LCA14-418: Testing a secure framework
LCA14: LCA14-418: Testing a secure frameworkLCA14: LCA14-418: Testing a secure framework
LCA14: LCA14-418: Testing a secure framework
 
Intro to RobotC
Intro to RobotCIntro to RobotC
Intro to RobotC
 
Matrix vision presentation
Matrix vision presentationMatrix vision presentation
Matrix vision presentation
 
Delta ia plc-dvp_tp_c_en_20160922
Delta ia plc-dvp_tp_c_en_20160922Delta ia plc-dvp_tp_c_en_20160922
Delta ia plc-dvp_tp_c_en_20160922
 
LCU14 500 ARM Trusted Firmware
LCU14 500 ARM Trusted FirmwareLCU14 500 ARM Trusted Firmware
LCU14 500 ARM Trusted Firmware
 
LCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted FirmwareLCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted Firmware
 
LAS16-400K2: TianoCore – Open Source UEFI Community Update
LAS16-400K2: TianoCore – Open Source UEFI Community UpdateLAS16-400K2: TianoCore – Open Source UEFI Community Update
LAS16-400K2: TianoCore – Open Source UEFI Community Update
 
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
 
HKG18-212 - Trusted Firmware M: Introduction
HKG18-212 - Trusted Firmware M: IntroductionHKG18-212 - Trusted Firmware M: Introduction
HKG18-212 - Trusted Firmware M: Introduction
 
Trusted firmware deep_dive_v1.0_
Trusted firmware deep_dive_v1.0_Trusted firmware deep_dive_v1.0_
Trusted firmware deep_dive_v1.0_
 
Lcu14 306 - OP-TEE Future Enhancements
Lcu14 306 - OP-TEE Future EnhancementsLcu14 306 - OP-TEE Future Enhancements
Lcu14 306 - OP-TEE Future Enhancements
 
Linux Audio Drivers. ALSA
Linux Audio Drivers. ALSALinux Audio Drivers. ALSA
Linux Audio Drivers. ALSA
 
LCA2018 Open Hardware MiniConference: LoliBot Software
LCA2018 Open Hardware MiniConference: LoliBot SoftwareLCA2018 Open Hardware MiniConference: LoliBot Software
LCA2018 Open Hardware MiniConference: LoliBot Software
 
20111130 hardware-monitoring-with-the-new-ipmi-plugin-v2
20111130 hardware-monitoring-with-the-new-ipmi-plugin-v220111130 hardware-monitoring-with-the-new-ipmi-plugin-v2
20111130 hardware-monitoring-with-the-new-ipmi-plugin-v2
 
Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)
 
Q2.12: Power Management Across OSs
Q2.12: Power Management Across OSsQ2.12: Power Management Across OSs
Q2.12: Power Management Across OSs
 
Plc ppt filke
Plc ppt filkePlc ppt filke
Plc ppt filke
 
[Wroclaw #3] Trusted Computing
[Wroclaw #3] Trusted Computing[Wroclaw #3] Trusted Computing
[Wroclaw #3] Trusted Computing
 

Similaire à #PDR15 - Voice API

Introduction to PICAXE Microcontrollers
Introduction to PICAXE MicrocontrollersIntroduction to PICAXE Microcontrollers
Introduction to PICAXE MicrocontrollersL. Paul Verhage
 
Video Conferencing : Fundamentals and Application
Video Conferencing : Fundamentals and ApplicationVideo Conferencing : Fundamentals and Application
Video Conferencing : Fundamentals and ApplicationVideoguy
 
Introduction to Vortex86EX Motion Control Modules
Introduction to Vortex86EX Motion Control ModulesIntroduction to Vortex86EX Motion Control Modules
Introduction to Vortex86EX Motion Control Modulesroboard
 
Track 3 session 8 - st dev con 2016 - music and voice over ble
Track 3   session 8 - st dev con 2016 - music and voice over bleTrack 3   session 8 - st dev con 2016 - music and voice over ble
Track 3 session 8 - st dev con 2016 - music and voice over bleST_World
 
LiveCoding Package for Pharo
LiveCoding Package for PharoLiveCoding Package for Pharo
LiveCoding Package for PharoESUG
 
Yeastar MyPBX-Basic configuration
Yeastar MyPBX-Basic configurationYeastar MyPBX-Basic configuration
Yeastar MyPBX-Basic configurationHossein Yavari
 
My Feb 2003 HPCA9 Keynote Slides - Billion Transistor Processor Chips
My Feb 2003  HPCA9 Keynote Slides - Billion Transistor Processor ChipsMy Feb 2003  HPCA9 Keynote Slides - Billion Transistor Processor Chips
My Feb 2003 HPCA9 Keynote Slides - Billion Transistor Processor ChipsDileep Bhandarkar
 
TinyML - 4 speech recognition
TinyML - 4 speech recognition TinyML - 4 speech recognition
TinyML - 4 speech recognition 艾鍗科技
 
BASIC COMPUTER ARCHITECTURE
BASIC COMPUTER ARCHITECTURE BASIC COMPUTER ARCHITECTURE
BASIC COMPUTER ARCHITECTURE Himanshu Sharma
 
Microprocessor fundamentals
Microprocessor fundamentalsMicroprocessor fundamentals
Microprocessor fundamentalsJLoknathDora
 
PIC32MX Microcontroller Family
PIC32MX Microcontroller FamilyPIC32MX Microcontroller Family
PIC32MX Microcontroller FamilyPremier Farnell
 
Iot Bootcamp - abridged - part 1
Iot Bootcamp - abridged - part 1Iot Bootcamp - abridged - part 1
Iot Bootcamp - abridged - part 1Marcus Tarquinio
 
44CON London 2015 - Reverse engineering and exploiting font rasterizers: the ...
44CON London 2015 - Reverse engineering and exploiting font rasterizers: the ...44CON London 2015 - Reverse engineering and exploiting font rasterizers: the ...
44CON London 2015 - Reverse engineering and exploiting font rasterizers: the ...44CON
 
An introduction to digital signal processors 1
An introduction to digital signal processors 1An introduction to digital signal processors 1
An introduction to digital signal processors 1Hossam Hassan
 
Programming on Windows 8.1: The New Stream and Storage Paradigm (Raffaele Ria...
Programming on Windows 8.1: The New Stream and Storage Paradigm (Raffaele Ria...Programming on Windows 8.1: The New Stream and Storage Paradigm (Raffaele Ria...
Programming on Windows 8.1: The New Stream and Storage Paradigm (Raffaele Ria...ITCamp
 

Similaire à #PDR15 - Voice API (20)

Introduction to PICAXE Microcontrollers
Introduction to PICAXE MicrocontrollersIntroduction to PICAXE Microcontrollers
Introduction to PICAXE Microcontrollers
 
Video Conferencing : Fundamentals and Application
Video Conferencing : Fundamentals and ApplicationVideo Conferencing : Fundamentals and Application
Video Conferencing : Fundamentals and Application
 
SPEECH CODING
SPEECH CODINGSPEECH CODING
SPEECH CODING
 
Introduction to Vortex86EX Motion Control Modules
Introduction to Vortex86EX Motion Control ModulesIntroduction to Vortex86EX Motion Control Modules
Introduction to Vortex86EX Motion Control Modules
 
Track 3 session 8 - st dev con 2016 - music and voice over ble
Track 3   session 8 - st dev con 2016 - music and voice over bleTrack 3   session 8 - st dev con 2016 - music and voice over ble
Track 3 session 8 - st dev con 2016 - music and voice over ble
 
LiveCoding Package for Pharo
LiveCoding Package for PharoLiveCoding Package for Pharo
LiveCoding Package for Pharo
 
Tos tutorial
Tos tutorialTos tutorial
Tos tutorial
 
Yeastar MyPBX-Basic configuration
Yeastar MyPBX-Basic configurationYeastar MyPBX-Basic configuration
Yeastar MyPBX-Basic configuration
 
Dsp ajal
Dsp  ajalDsp  ajal
Dsp ajal
 
Audio equalizer
Audio equalizerAudio equalizer
Audio equalizer
 
Lec09-DSP.pdf
Lec09-DSP.pdfLec09-DSP.pdf
Lec09-DSP.pdf
 
My Feb 2003 HPCA9 Keynote Slides - Billion Transistor Processor Chips
My Feb 2003  HPCA9 Keynote Slides - Billion Transistor Processor ChipsMy Feb 2003  HPCA9 Keynote Slides - Billion Transistor Processor Chips
My Feb 2003 HPCA9 Keynote Slides - Billion Transistor Processor Chips
 
TinyML - 4 speech recognition
TinyML - 4 speech recognition TinyML - 4 speech recognition
TinyML - 4 speech recognition
 
BASIC COMPUTER ARCHITECTURE
BASIC COMPUTER ARCHITECTURE BASIC COMPUTER ARCHITECTURE
BASIC COMPUTER ARCHITECTURE
 
Microprocessor fundamentals
Microprocessor fundamentalsMicroprocessor fundamentals
Microprocessor fundamentals
 
PIC32MX Microcontroller Family
PIC32MX Microcontroller FamilyPIC32MX Microcontroller Family
PIC32MX Microcontroller Family
 
Iot Bootcamp - abridged - part 1
Iot Bootcamp - abridged - part 1Iot Bootcamp - abridged - part 1
Iot Bootcamp - abridged - part 1
 
44CON London 2015 - Reverse engineering and exploiting font rasterizers: the ...
44CON London 2015 - Reverse engineering and exploiting font rasterizers: the ...44CON London 2015 - Reverse engineering and exploiting font rasterizers: the ...
44CON London 2015 - Reverse engineering and exploiting font rasterizers: the ...
 
An introduction to digital signal processors 1
An introduction to digital signal processors 1An introduction to digital signal processors 1
An introduction to digital signal processors 1
 
Programming on Windows 8.1: The New Stream and Storage Paradigm (Raffaele Ria...
Programming on Windows 8.1: The New Stream and Storage Paradigm (Raffaele Ria...Programming on Windows 8.1: The New Stream and Storage Paradigm (Raffaele Ria...
Programming on Windows 8.1: The New Stream and Storage Paradigm (Raffaele Ria...
 

Plus de Pebble Technology

#PDR15 - Awesome Appstore Assets
#PDR15 - Awesome Appstore Assets#PDR15 - Awesome Appstore Assets
#PDR15 - Awesome Appstore AssetsPebble Technology
 
#PDR15 - Smartstrap Workshop
#PDR15 - Smartstrap Workshop#PDR15 - Smartstrap Workshop
#PDR15 - Smartstrap WorkshopPebble Technology
 
#PDR15 - Data Analytics and Pebble
#PDR15 - Data Analytics and Pebble#PDR15 - Data Analytics and Pebble
#PDR15 - Data Analytics and PebblePebble Technology
 
#PDR15 - Best Use Cases For Timeline
#PDR15 - Best Use Cases For Timeline#PDR15 - Best Use Cases For Timeline
#PDR15 - Best Use Cases For TimelinePebble Technology
 
#PDR15 - waf, wscript and Your Pebble App
#PDR15 - waf, wscript and Your Pebble App#PDR15 - waf, wscript and Your Pebble App
#PDR15 - waf, wscript and Your Pebble AppPebble Technology
 
#PDR15 Creating Pebble Apps for Aplite, Basalt, and Chalk
#PDR15 Creating Pebble Apps for Aplite, Basalt, and Chalk#PDR15 Creating Pebble Apps for Aplite, Basalt, and Chalk
#PDR15 Creating Pebble Apps for Aplite, Basalt, and ChalkPebble Technology
 
#PDR15 - Developing for Round
#PDR15 - Developing for Round#PDR15 - Developing for Round
#PDR15 - Developing for RoundPebble Technology
 
#PDR15 - Designing for Pebble
#PDR15 - Designing for Pebble#PDR15 - Designing for Pebble
#PDR15 - Designing for PebblePebble Technology
 
Overlay Technique | Pebble Developer Retreat 2014
Overlay Technique | Pebble Developer Retreat 2014Overlay Technique | Pebble Developer Retreat 2014
Overlay Technique | Pebble Developer Retreat 2014Pebble Technology
 
Overlay & Libraries | Pebble Meetup Oct. 2014
Overlay & Libraries | Pebble Meetup Oct. 2014Overlay & Libraries | Pebble Meetup Oct. 2014
Overlay & Libraries | Pebble Meetup Oct. 2014Pebble Technology
 
Connecting Pebble to the World
Connecting Pebble to the WorldConnecting Pebble to the World
Connecting Pebble to the WorldPebble Technology
 
Guest Presentation - Strap | Pebble Developer Retreat 2014
Guest Presentation - Strap | Pebble Developer Retreat 2014Guest Presentation - Strap | Pebble Developer Retreat 2014
Guest Presentation - Strap | Pebble Developer Retreat 2014Pebble Technology
 
Battery Life | Pebble Developer Retreat 2014
Battery Life | Pebble Developer Retreat 2014Battery Life | Pebble Developer Retreat 2014
Battery Life | Pebble Developer Retreat 2014Pebble Technology
 
Thomas Sarlandie Kickoff Talk | Pebble Developer Retreat 2014
Thomas Sarlandie Kickoff Talk | Pebble Developer Retreat 2014Thomas Sarlandie Kickoff Talk | Pebble Developer Retreat 2014
Thomas Sarlandie Kickoff Talk | Pebble Developer Retreat 2014Pebble Technology
 
Advanced Techniques: Size | Pebble Developer Retreat 2014
Advanced Techniques: Size | Pebble Developer Retreat 2014Advanced Techniques: Size | Pebble Developer Retreat 2014
Advanced Techniques: Size | Pebble Developer Retreat 2014Pebble Technology
 
Advanced Techniques: Graphics | Pebble Developer Retreat 2014
Advanced Techniques: Graphics | Pebble Developer Retreat 2014Advanced Techniques: Graphics | Pebble Developer Retreat 2014
Advanced Techniques: Graphics | Pebble Developer Retreat 2014Pebble Technology
 

Plus de Pebble Technology (20)

#PDR15 - Awesome Appstore Assets
#PDR15 - Awesome Appstore Assets#PDR15 - Awesome Appstore Assets
#PDR15 - Awesome Appstore Assets
 
#PDR15 - Smartstrap Workshop
#PDR15 - Smartstrap Workshop#PDR15 - Smartstrap Workshop
#PDR15 - Smartstrap Workshop
 
#PDR15 - Data Analytics and Pebble
#PDR15 - Data Analytics and Pebble#PDR15 - Data Analytics and Pebble
#PDR15 - Data Analytics and Pebble
 
#PDR15 - Best Use Cases For Timeline
#PDR15 - Best Use Cases For Timeline#PDR15 - Best Use Cases For Timeline
#PDR15 - Best Use Cases For Timeline
 
#PDR15 - waf, wscript and Your Pebble App
#PDR15 - waf, wscript and Your Pebble App#PDR15 - waf, wscript and Your Pebble App
#PDR15 - waf, wscript and Your Pebble App
 
#PDR15 - PebbleKit iOS 3.0
#PDR15 - PebbleKit iOS 3.0#PDR15 - PebbleKit iOS 3.0
#PDR15 - PebbleKit iOS 3.0
 
#PDR15 - Pebble Graphics
#PDR15 - Pebble Graphics#PDR15 - Pebble Graphics
#PDR15 - Pebble Graphics
 
#PDR15 Creating Pebble Apps for Aplite, Basalt, and Chalk
#PDR15 Creating Pebble Apps for Aplite, Basalt, and Chalk#PDR15 Creating Pebble Apps for Aplite, Basalt, and Chalk
#PDR15 Creating Pebble Apps for Aplite, Basalt, and Chalk
 
#PDR15 - Developing for Round
#PDR15 - Developing for Round#PDR15 - Developing for Round
#PDR15 - Developing for Round
 
#PDR15 - Designing for Pebble
#PDR15 - Designing for Pebble#PDR15 - Designing for Pebble
#PDR15 - Designing for Pebble
 
#PDR15 Kick-Off
#PDR15 Kick-Off#PDR15 Kick-Off
#PDR15 Kick-Off
 
Pebble Slate Workshop
Pebble Slate WorkshopPebble Slate Workshop
Pebble Slate Workshop
 
Overlay Technique | Pebble Developer Retreat 2014
Overlay Technique | Pebble Developer Retreat 2014Overlay Technique | Pebble Developer Retreat 2014
Overlay Technique | Pebble Developer Retreat 2014
 
Overlay & Libraries | Pebble Meetup Oct. 2014
Overlay & Libraries | Pebble Meetup Oct. 2014Overlay & Libraries | Pebble Meetup Oct. 2014
Overlay & Libraries | Pebble Meetup Oct. 2014
 
Connecting Pebble to the World
Connecting Pebble to the WorldConnecting Pebble to the World
Connecting Pebble to the World
 
Guest Presentation - Strap | Pebble Developer Retreat 2014
Guest Presentation - Strap | Pebble Developer Retreat 2014Guest Presentation - Strap | Pebble Developer Retreat 2014
Guest Presentation - Strap | Pebble Developer Retreat 2014
 
Battery Life | Pebble Developer Retreat 2014
Battery Life | Pebble Developer Retreat 2014Battery Life | Pebble Developer Retreat 2014
Battery Life | Pebble Developer Retreat 2014
 
Thomas Sarlandie Kickoff Talk | Pebble Developer Retreat 2014
Thomas Sarlandie Kickoff Talk | Pebble Developer Retreat 2014Thomas Sarlandie Kickoff Talk | Pebble Developer Retreat 2014
Thomas Sarlandie Kickoff Talk | Pebble Developer Retreat 2014
 
Advanced Techniques: Size | Pebble Developer Retreat 2014
Advanced Techniques: Size | Pebble Developer Retreat 2014Advanced Techniques: Size | Pebble Developer Retreat 2014
Advanced Techniques: Size | Pebble Developer Retreat 2014
 
Advanced Techniques: Graphics | Pebble Developer Retreat 2014
Advanced Techniques: Graphics | Pebble Developer Retreat 2014Advanced Techniques: Graphics | Pebble Developer Retreat 2014
Advanced Techniques: Graphics | Pebble Developer Retreat 2014
 

Dernier

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 

Dernier (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

#PDR15 - Voice API

  • 1. 2015 Pebble Developer Retreat Voice on Pebble Andrew Stapleton, Firmware Engineer
  • 2. Voice • Intro • Basic overview • Dictation API - Intro • Dictation API - Example app • How it works • Do’s and don’ts with the API • Development Help
  • 3. Voice Overview Microphone MCU PDM -> PCM Speex Encoder Dictation UI Recognizer 6 1 2 3 4 5
  • 4. Examples • General text input • Voice notes • Voice commands (tell your phone what to do) • Translation tool • Search/contextual query interface • Messaging • Twitter interface
  • 5. API - The Basics DictationSession *dictation_session_create(uint32_t buffer_size,
 DictationSessionStatusCallback callback,
 void *callback_context); 
 
 typedef void (*DictationSessionStatusCallback)(DictationSession *session,
 DictationSessionStatus status, 
 char *transcription,
 void *context); 
 
 DictationSessionStatus dictation_session_start(DictationSession *session);
  • 9. Dictation UI Flow 1 2 3 FailureConnectivityError FailureDisabled
  • 10. API - Advanced Usage void dictation_session_enable_error_dialogs(DictationSession *session,
 bool is_enabled); 
 
 void dictation_session_enable_confirmation(DictationSession *session,
 bool is_enabled); 
 
 DictationSessionStatus dictation_session_stop(DictationSession *session);
  • 11. Dictation UI Flow • No confirmation dialog UI Started Speech ends 1 2 3
  • 12. API - Demo • Translation tool • Use dictation session to get text to be translated from user • Use Google Translate API to translate the text • Display response in the form of text to user
  • 13. #define BUFFER_SIZE (512) static void init(void) { session = dictation_session_create(BUFFER_SIZE, handle_dictation_result, NULL); if (!session) { APP_LOG(APP_LOG_LEVEL_ERROR, "No phone connected, platform is not supported or " "phone app does not support dictation APIs!"); } // more initialization }
  • 14. static void select_click_handler(ClickRecognizerRef recognizer, void *context) { dictation_session_start(session); } static void handle_dictation_result(DictationSession *session, DictationSessionStatus status, char *transcription, void *context) { if (status == DictationSessionStatusSuccess) { if (dictation_result) { free(dictation_result); } const char *preamble = "ENG: "; size_t len = strlen(transcription); dictation_result = malloc(len + strlen(preamble) + 1); strcpy(dictation_result, preamble); strcat(dictation_result, transcription); text_layer_set_text(q_text_layer, dictation_result); } else { // handle errors } }
  • 17. static void init(void) { session = dictation_session_create(BUFFER_SIZE, handle_dictation_result, NULL); if (!session) { APP_LOG(APP_LOG_LEVEL_ERROR, "No phone connected, platform is not supported or " "phone app does not support dictation APIs!"); } dictation_session_enable_confirmation(session, false /* is_enabled */); // more initialization }
  • 19. Recognizer How it Works - Microphone Microphone MCU PDM -> PCM Speex Encoder Dictation UI6 1 2 3 4 5
  • 20. How it Works - Microphone • Single, MEMS (microelectromechanical system) microphone • PDM output @ ~1MHz •Pulse Density Modulation •1 bit signal that encodes 16-bit data • Pass 1 bit signal through decimation and low pass filter to convert to 16-bit PCM (Pulse code modulation) data at 16kHz Decimation + LPF
  • 21. Recognizer How it Works - Encoder Microphone MCU PDM -> PCM Speex Encoder Dictation UI6 1 2 3 4 5
  • 22. How it Works - Encoder • Why encode? •Bluetooth throughput limited • Why Speex? •Developed specifically for voice encoding •Outperforms most telephony codecs (compression ratio v quality) •Tunable quality •Recovers from dropped frames
  • 23. How it Works - Encoder • CELP (Code-excited linear prediction) coding • Converts PCM to a sequence of frames • Converts 16kHz, 16-bit PCM signal (256kbps) to a 12.8kbps sequence of frames • ~50% CPU cost
  • 24. How it Works - The rest Microphone MCU PDM -> PCM Speex Encoder Dictation UI6 1 2 3 4 5 Recognizer
  • 25. Do’s and Don’ts • Only create one session instance (~1.5kB RAM + buffer space) - it can be reused. • While session is in progress: •No heavy processing •No appmessage • Clean up the session to recover precious RAM • If you decide to disable error messages, provide some useful feedback for the user.
  • 26. Do’s and Don’ts • Common failures: •user not speaking clearly (helps to enunciate and 
 speak slowly) •background noise. • Encourage users to keep phrases brief • Voice language setting may be different from 
 watch language
  • 27. Development Tools • Dictation API works in local emulator! • Coming to CloudPebble soon! • To use with the emulator: •Fire up the emulator •With the pebble tool: •Use voice-enabled app like you would on a watch $  pebble  transcribe  <status  code>  -­‐t  <transcription  string>   $  pebble  transcribe  0  -­‐t  “What  is  the  current  time  in  London  England"
  • 28. More Info • API Documentation: http://developer.getpebble.com/docs/c/ preview/Foundation/Dictation/ • Guide: https://developer.getpebble.com/guides/pebble- apps/sensors/dictation/ • Example: https://github.com/pebble-hacks/voice-demo