我在使用iOS 8.0.2和XCode 5上的AVSpeechSynthesis時遇到了問題。我在模擬器上試了一下,發現「語音初始化錯誤:2147483665」。然後我在iPhone 5上試了一下,沒有發現任何錯誤,但沒有發言。AVFoundation語音合成iOS 8和XCode 6
在我的.h文件我輸入
進口
,並有@property(強,非原子)AVSpeechSynthesizer *合成;
在我的.m文件我合成的合成
我有AVFoundation在我的框架中引用
在我viewDidLoad中我下面
self.synthesizer = [[AVSpeechSynthesizer的alloc]初始化] ; self.synthesizer.delegate = self;
後來在我的代碼來控制什麼是說我下面
AVSpeechUtterance *utterance = [[AVSpeechUtterance alloc] initWithString:dialog];
utterance.rate = AVSpeechUtteranceDefaultSpeechRate;
utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-au"];
[self.synthesizer speakUtterance:utterance];
我有CCViewController:的UIViewController在我的視圖控制器。
有誰知道什麼是錯的? AVFoundation是否適用於iOS 8?
我看到一個類似的帖子在堆棧溢出說,以初始化我的發言@「」,但沒有奏效。
任何幫助,將不勝感激。
感謝, 格雷格
8.1模擬器不做TTS。下載7.1模擬器並將其用於測試。 – vijayst 2014-11-06 07:45:06