为什么我在上运行时遇到错误iOS6虽然我检查了AVSpeechSynthesizer
?我知道AVSpeechSynthesizer仅适用于iOS7iOS 6 - 使用AVSpeechSynthesizer发行
if (NSClassFromString(@"AVSpeechSynthesizer")) {
AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc] init];
AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:@"Just what do you think you're doing, Dave?"];
utterance.rate = AVSpeechUtteranceMinimumSpeechRate; // Tell it to me slowly
[synthesizer speakUtterance:utterance];
}
@import AVFoundation; – Vjy