Skip to content

lashad/PTeSpeak

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

PTeSpeak

Do you want your iPhone/iPad to speak Georgian? Or any other language ? PTeSpeak is a wrapper class for popular open source engine eSpeak.

How to build demo app

  • Git clone PTeSpeak demo app to your local disk.
  • Download the latest eSpeak development version at Downlaod. Extract and copy entire directory espeak-1.46.14 to your just cloned PTeSpeak directory.
  • Open PTeSpeak.xcodeproj XCode project and run demo app.

Note: You need XCode 4.0 in order to build and run demo app.

How to use

  1. Copy PTeSpeak.m and PTeSpeak.h files to your source tree and add it to XCode project.
  2. Implement PTeSpeakDelegate protocol.
  3. Add AudioToolbox.framework to your project.
  4. Just #import the PTeSpeak.h header

#import "PTeSpeak.h"

Example of how to create PTeSpeak class to synthesize speech:

PTeSpeak *espeak = [PTeSpeak sharedPTeSpeak];

[espeak setDelegate:self];
[espeak setupWithVoice:@"ka" volume:100 rate:150 pitch:40];
[espeak speak:@"ფიცარი"];

Your class will have to implement the PTeSpeakDelegate protocol, and to implement the speakDidStart:, speakDidEnd: and speakWithError:error: methods from this protocol:

- (void)speakDidStart:(PTeSpeak *)espeak
{
    NSLog(@"Start speaking…");
}

- (void)speakDidEnd:(PTeSpeak *)espeak
{
    NSLog(@"Stop speaking…");
}

- (void)speakWithError:(PTeSpeak *)espeak error:(OSStatus)error
{
    NSLog(@"Error %d while speaking", error);
}

Class References

PTeSpeak

setupWithVoice

- (NSInteger)setupWithVoice:(NSString*)voiceName volume:(NSInteger)volume rate:(NSInteger)rate pitch:(NSInteger)pitch

Setup espeak engine. voiceName - Languge ISO2 code (e.g. ka - Georgian, en - English) volume - Voice amplitude (0 to 200) rate - Speed in words per minute (80 to 450) pitch - Pitch adjustment (0 to 99)

speak

- (void)speak:(NSString*)text

text to speak.

isSpeak

- (BOOL)isSpeak

Check speak status.

stop

- (BOOL)stop

Stop speaking.

pause

- (BOOL)pause

Pause speaking.

start

- (BOOL)start

Start speaking.

License

(The MIT License)

Copyright (c) 2012 Picktek LLC

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

eSpeak speech synthesizer wrapper class.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages