0

这个简单的代码在我的 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];
} 
4

1 回答 1

0

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

于 2014-10-23T17:17:26.947 回答