AVSpeechSynthesizer无法在iPad上运行

时间:2014-09-18 16:57:33

标签: ipad avspeechsynthesizer

这个简单的代码在我的iPhone上工作正常,但在我的Pad上没有。无论如何,语音合成器在iPad上保持沉默。可能是什么问题呢?从所选文字讲话确实可以在iPad上运行,没有错误。没有警告,没有消息,没有。

我在iOS7上使用Xcode 6,iPhone 5s和iPad 4。

#import <AVFoundation/AVFoundation.h>

AVSpeechSynthesizer *synthesizer; 

@interface ViewController ()

@end

@implementation ViewController
- (IBAction)Speak:(id)sender 
{  NSString* Phrase = @"Hello world!"; 
   synthesizer = [[AVSpeechSynthesizer alloc]init]; // init speech synth }
   AVSpeechUtterance *utterance = [[AVSpeechUtterance alloc] initWithString:Phrase];   
   [synthesizer speakUtterance:utterance];
} 

1 个答案:

答案 0 :(得分:0)

这是一个8.0 bug。 @(#)8.1解决了问题。

相关问题