1

I am using OpenEars in my app for speech to text conversion, but now the situation demands that I convert my text to speech. Can I do this using OpenEars only? Has anyone tried this?

If so, please guide me on how to do this. Any help will be appreciated.

Halle
  • 3,584
  • 1
  • 37
  • 53
Vipin
  • 4,718
  • 12
  • 54
  • 81

2 Answers2

6

Yes it is possible through open ears. You can look at the sample project provided in the Openears itself with the help of FliteController.

There is method called say.

e.g.

 -(void)viewDidLoad {
     [super viewDidLoad];
     // This is how to use an available instance of FliteController.
     [fliteController say:@"Welcome to OpenEars."]; 
 }

Hope it helps.

Janak Nirmal
  • 22,706
  • 18
  • 63
  • 99
  • thanks a lot ,let me try it and if it works then i will accept your answer ,,thanks a lot – Vipin Jun 03 '11 at 10:36
  • do i have to add any new framework for this and also do i have to import any file like we do "#import pocketSphinxController.h" – Vipin Jun 03 '11 at 10:51
  • @Christina If you have installed OpenEars properly no need to install anything else. Just go to sample application (OpenEarsSampleProject) provided in there. You will find the code in OpenEarsSampleProjectViewController. – Janak Nirmal Jun 03 '11 at 10:57
  • The FliteController say: method has changed in .91, it's now necessary to also specify a voice (this allows changing voices in-app): [self.fliteController say:@"Welcome to OpenEars." withVoice:@"cmu_us_awb8k"]; – Halle Jun 03 '11 at 15:27
2

In a class in which you want to use FliteController you need to import FliteController.h:

#import "FliteController.h"

Next, you need to open OpenEarsVoiceConfig.h in a correctly-configured installation and uncomment the voices you need to use, as explained in that file.

Then you can instantiate FliteController and send it the following message using a voice you've uncommented:

[self.fliteController say:@"A phrase I'd like my app to speak out loud." withVoice:@"cmu_us_awb8k"];

That should be sufficient if you're clear on how to instantiate the object and your installation of OpenEars is correct. If not, there is even more detail on the specifics at the following URL:

http://www.politepix.com/openears/yourapp/

Halle
  • 3,584
  • 1
  • 37
  • 53