RAD Studio 10.4.1 is now available! Learn more. Looking for discounts? Visit our Special Offers page!
Delphi

Delphi XE5 Android Text to Speech example in CodeCentral

Author: Joshua P7819

Jeff Overcash, TeamB member and the maintainer of the InterBase Express Components (IBX) for the past 13.5 years, has created a Delphi wrapper unit for Android text to speech functionality.  Jeff has also created a simple demo example that allows you to input some text into a TMemo and hear the text spoken on your Android device.  In a comment on the Delphi XE5 Android API Documentation forum, Jeff said he looked at the Java API source code to create the Delphi Text To Speech (TTS) unit.  He also mentioned an Android text to speech tutorial article that helped him – http://www.androidhive.info/2012/01/android-text-to-speech-tutorial/.

The Delphi XE5 Android Text to Speech (TTS) API wrapper unit, Androidapi.JNI.TTS.pas, is included in the example Jeff has uploaded to CodeCentral – http://cc.embarcadero.com/item/29594.  The code that takes the text in the TMemo component and sends it to the Android TTS API is:

Thank you Jeff for showing everyone how they can call Android API functionality from Dephi XE5. With Delphi XE5 you can always get to any OS APIs using the OCClass bridge (for iOS) and JavaClass bridge (for Android). The RTL contains a number of units that provide Delphi interfaces to iOS frameworks written in Objective-C. These units are scoped with iOSapi and are found in the /source/rtl/ios directory of your product installation. For Android, Delphi also includes a number of units for the interfaces to Android APIs with the unit name scope of Androidapi and are found int he /source/rtl/android directory of your installation.

Another simple example that shows you how to use the Objective-C bridge (OCClass) and Java Bridge (JavaClass) to call into the OS is the DeviceInfo mobile code snippet you can find as part of the install at C:UsersPublicDocumentsRAD Studio12.0SamplesMobileCodeSnippetsDeviceInfo.


Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Learn More About Upgrading

Related posts
CodeDelphiRAD Studio

Learn How To Use FireDAC In The Dynamic-Link Libraries With DLL Sharing Sample In Delphi

CodeDelphiRAD StudioTech Partner

Powerful Cross Platform TeeGrid Is Capable Of Handling A Large Number Of Cells In Delphi FireMonkey

CodeDelphiRAD Studio

Learn How To Use Connection Pooling With A Multi-threaded Environment In Delphi

CodeDatabaseDelphiRAD Studio

Quickly Share Data Between Datasets Using CloneCursor In This Native Windows Sample For Delphi

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

IN THE ARTICLES