Upload
jim-mckeeth
View
2.466
Download
3
Embed Size (px)
DESCRIPTION
Adding voice launch, speech recognition and text to speech to Android and Google Glass. See also http://delphi.org/2014/07/android-voice/
Citation preview
EMBARCADERO TECHNOLOGIES EMBARCADERO TECHNOLOGIES
Add Voice to All Your Android Apps Jim McKeeth Lead World Wide Developer Evangelist & Engineer [email protected] @JimMcKeeth
10th of July, 2014 Download a free trial – NOW! hLp://embt.co/trialdownloads
EMBARCADERO TECHNOLOGIES
Agenda
• Voice Launching Google Glass Apps – Standard Triggers – Unlisted Triggers
• AddiUonal Prompts on Google Glass • Voice RecogniUon on Android • Text-‐To-‐Speech on Android
EMBARCADERO TECHNOLOGIES
Voice Launching Google Glass Apps
• Add a Voice Trigger XML file: – Choose a Standard Voice command hLp://embt.co/glass-‐voice-‐triggers
– Deploy to res\xml\ folder. • Modify the Android Manifest Template:
– Add an Intent Filter • <action android:name="com.google.android.glass.action.VOICE_TRIGGER"/>
– Add Meta Data for Filter • <meta-‐data android:name="com.google.android.glass.VoiceTrigger”
android:resource="@xml/my_voice_trigger" />
EMBARCADERO TECHNOLOGIES
Custom Glass Voice Trigger
• Change XML to from Command to Keyword. • Use arbitrary text for voice trigger. • Use the Development permission:
– <uses-‐permission android:name="com.google.android.glass.permission.DEVELOPMENT"/>
– Added to android manifest template
• Not allowed for distribuUon – Usable for in-‐house use
EMBARCADERO TECHNOLOGIES
AddiConal Prompts on Google Glass
• Collect addiUonal Voice recogniUon input when app is launched. – Add an Input Prompt to the Voice Trigger XML
<?xml version="1.0" encoding="UTF-‐8"?> <trigger command="TAKE_A_NOTE"> <input prompt="What shall I say?" /> </trigger>
• In FormCreate get speech guesses from Intent Extras – SharedActivity.getIntent.getExtras.
getStringArrayList(TJRecognizerIntent.JavaClass.EXTRA_RESULTS);
EMBARCADERO TECHNOLOGIES
Voice RecogniCon on Android
• Prompts user for voice input • Returns up to 5 “guesses” • Works offline too – (only returns 1 guess)
• Reusable component for download.
EMBARCADERO TECHNOLOGIES
Text-‐To-‐Speech on Android
• Converts Text to spoken word.
• Reusable component based on Jeff Overcash’s translaUon.
• Example of handling Java Listener events.
EMBARCADERO TECHNOLOGIES
Android Voice Summary
• Using Voice to Launch on Google Glass • Google Glass Prompts for Voice Input • Voice RecogniUon on Android • Text-‐To-‐Speech on Android
EMBARCADERO TECHNOLOGIES
Android JNI Resources
• Samples – C:\Users\Public\Documents\Embarcadero\Studio\14.0\Samples\Object Pascal\Mobile Samples\Google Glass
• DocWiki – hLp://docwiki.embarcadero.com/CodeExamples/XE6/en/FMX.Mobile.GoogleGlass_Sample_(Delphi)
• Glass Launch Commands – hLp://embt.co/glass-‐voice-‐triggers
• Blog Post – Slides & New Samples – hLp://delphi.org/2014/07/android-‐voice/ (Later today)
Download a free trial – NOW! hNp://embt.co/trialdownloads
EMBARCADERO TECHNOLOGIES
Next Time….
• Use the Database Explorer with FireDAC – Make your database applicaUon development even more producUve with help form the Database Explorer and FireDAC.
• Tuesday the 15th of July – 6AM San Francisco / 9AM New York / 2PM London / 3PM Milan – 11AM San Francisco / 2PM New York / 7PM London / 8PM Milan – 5PM San Francisco / Wed 9AM Tokyo / Wed 10AM Sydney
Download your free trial now! -‐ hLp://embt.co/trialdownloads