Click here to Skip to main content
Click here to Skip to main content

FliteEngine - Objective-C speech synthesizer

By , 21 Jan 2012
Rate this:
Please Sign up or sign in to vote.

Introduction

This is the second speech synthesizer wrapper as I wrote in my previous article ESpeakEngine. The following sections describe the Flite speech synthesizer wrapper - FliteEngine.

Background

FliteEngine is an Objective-C static library project containing a very light wrapper for the Flite Open Source speech synthesizer. It does not add any new features to Flite, it only exposes its functionality as Objective-C class methods and combines this functionality with the iOS AVFoundation Framework (to see all available properties of the Flite synthesizer, please read the documentation on its homepage URL). It also uses the standard delegate pattern by defining FliteEngineDelegate.

Using the code

Usage of the FliteEngine is very easy. You have to only add a standard dependency on the FliteEngine static library project to your project and add a path to the folder Flite_1_0/Classes in the Target Build Settings: Header Search Paths.

Then import the FliteEngine header in the class which is holding the engine instance:

#import "FliteEngine.h"

In the init or the viewDidLoad method, create a new instance of the FliteEngine and set all parameters you want (volume, speed, variance, pitch):

- (void)viewDidLoad {
    [super viewDidLoad];
    engine = [[FliteEngine alloc] init];
    engine.volume = 1;
}

And finally, bind any button's touch event to the code which calls the FliteEngine speak method:

- (IBAction)speech {
    NSString * text = self.textView.text;
    [engine speak:text];
}

Points of Interest

No documentation is included in this up-to-date version. Anyhow, the source code is self-explanatory and has altogether only a few hundred lines. Also, the test application is a good start point to look for more properties.

Any questions will be answered, feel free to contact me.

History

  • 2010: Initial version.

License

This article, along with any associated source code and files, is licensed under The BSD License

About the Author

Jozef Bozek
CEO bring-it-together s.r.o.
Slovakia Slovakia
Jozef Božek is currently a software engineer at bring-it-together s.r.o. in area of large scale infomation systems and mobile applications development.
He has been developing in C++ nearly full time since 2000, in Java since 2004 and in Objective-C since 2009. He is programming using Java EE SDK, iOS SDK, COM/DCOM, MFC, ATL, STL and so on Smile | :)
Follow on   Twitter   Google+

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web02 | 2.8.140415.2 | Last Updated 21 Jan 2012
Article Copyright 2012 by Jozef Bozek
Everything else Copyright © CodeProject, 1999-2014
Terms of Use
Layout: fixed | fluid