我正在使用iPhone应用程序,我需要整合Google Text-To-Speach(Google TTS)。
它仅适用于英文字母中的字符。当尝试使用特殊字符(如Ᾰ,Д,И)形成链接(linkTTS)时,它不再起作用。代码如下所示:
lblvoice = [[NSString alloc] initWithFormat: @"http://translate.google.com/translate_tts?tl=%@&q=%@" ,@"fr", @"é"];
lblvoice = [lblvoice stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSURL *newMovieURL = [NSURL URLWithString:lblvoice];
player = [[AVPlayer alloc] initWithURL:newMovieURL];
[player play];