The catch is that it's limited to just 100 characters and you never know when Google might pull the plug on it, but still, it's pretty cool.
#import <AVFoundation/AVFoundation.h>
...
NSString *linkTTS = [NSString stringWithFormat:@"http://translate.google.com/translate_tts?tl=en&q=%@",@"this+is+really+quite+cool"];
NSData *dataTTS = [NSData dataWithContentsOfURL:[NSURL URLWithString:linkTTS]];
AVAudioPlayer *_googlePlayer = [[AVAudioPlayer alloc] initWithData:dataTTS error:nil];
[_googlePlayer play];
No comments:
Post a Comment