giovedì 18 agosto 2011

GPSpeechSynth - General Purpose Speech Synth (UPDATED)

Is not clear to me why so many people want to have an iOS eSpeak port. All the applications built on top of such port cannot be distributed via Apple app store. May be the plan is to distribute on jailbreak iPhones.

So, you convinced me, let see what will happen. I just added the GPSpeechSynth library code on github. There is a Xcode project that generates three different static libraries. One based on eSpeak v1.44.05 (I didn't have time to update it to the latest version) and other two based on FLite 1.4
The library based on FLite 1.4 was successfully used in Math Teacher application that is now distributed by Apple. here you have the links:

UPDATE (17th Nov 2011):
I just added a working example in this repo.

john boydon

6 commenti:

  1. Thanks for sharing the espeak port. However, I can't seem to get it to pronounce more than the first very small portion of a word if trying to get it to repeat back single words. It will start to pronounce the word for about the first few milliseconds and then stop playing back. Any ideas?

  2. As follow-up, I tried making the problem smaller by just creating a blank window application and seeing if it will work using defaults by doing this. It is trying to synthesize "little testing synthesis". I can hear that is trying to playback something because I can hear "li" and then the speech synthesis abruptly stops before it completes saying the first word ("little").

    To make sure that AVAudioPlayer is properly working, I tried adding it to playback a simple WAV file - that part works fine when uncommented.

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    // Override point for customization after application launch.
    [self.window makeKeyAndVisible];
    GPSpeechSynthesizer *synth = [GPSpeechSynthesizer sharedGPSpeechSynthesizer];
    GPSpeechSynthesis *speech = [synth synthesize:@"little testing synthesis"];
    [speech startSpeaking];

    /* NSURL *testAudio = [[NSBundle mainBundle] URLForResource:@"page1" withExtension:@"wav"];
    AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:testAudio error:nil];
    player.volume = 0.05f;
    [player play]; */
    return YES;

  3. Ok more background info - I think I know what's wrong. Modifying the GPSpeech source to not delete the temp WAV file, I can hear that the tmp wave file is created correctly. It appears that it is attempting to create an AVAudioPlayer before the WAV file is ready - almost seems like WAV file is made asynchronously.

    Using the GPSpeech Flite version has the same problem.

  4. Hi all, in this repository: there is a working example.

    I tested it on iOS 5 with iPhone simulator.


  5. For Daniel Huang -> Please notice that when you create the speech using synthesize: method, the return object is autorelased. If you don't retain it, then at the next iteration of application loop it will be released and so the player will be interrupted.

    To verify if my hypothesis is correct add a breakpoint in GPSpeechSynthesis.dealloc method and check if it is reached.


  6. 404 url error on github i think source code is removed

    i want TTS which can also reach to apple store in paid apps can u provide me such application