Skip to content
This repository has been archived by the owner on Mar 4, 2022. It is now read-only.

marceloqueiroz/GoogleTTSAPI

Repository files navigation

GoogleTTSAPI

Google Text to Speech API is an iOS drop-in class that adds text to speech functionality to your app. The API was developed using an undocumented Google APIs.

Requirements

GoogleTTSAPI works on any iOS version and is compatible with both ARC projects. It depends on the following Apple frameworks, which should already be included with most Xcode templates:

  • Foundation.framework
  • UIKit.framework

Usage

GoogleTTSAPI provides two methods that can be used to convert your text. Both of them are executed on background.

NSString *text = @"Hello world";
NSString *language = @"en";
[GoogleTTSAPI textToSpeechWithText:text andLanguage:language success:^(NSData *data) {
	// Handle the returned NSData. Typically write it to a file and then play it
} failure:^(NSError *error) {
	// Handler error here
}];

When the language is not provided, the GoogleTTSAPI uses the device's current locale.

NSString *text = @"Hello world";
[GoogleTTSAPI textToSpeechWithText:text success:^(NSData *data) {
	// Handle the returned NSData. Typically write it to a file and then play it
} failure:^(NSError *error) {
	// Handler error here
}];

For more details, take a look at the bundled demo project.

License

This code is distributed under the terms and conditions of the Apache v2 License.

Change-log

A brief summary of each GoogleTTSAPI release can be found on the wiki