当我尝试以下代码时,我收到以下消息:
2014-07-28 13:19:14.251 MySingleView [3750:461865]语音初始化错误:2147483665
我做错了,还是这个bug?
我正在使用Xcode6 – Beta 4在我的Mac上运行小牛的iPad 2模拟器中运行。
import UIKit import AVFoundation class ViewController: UIViewController { var voice = AVSpeechSynthesizer() override func viewDidLoad() { super.viewDidLoad() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } @IBAction func buttonPushed(sender: UIButton) { var utterance = AVSpeechUtterance(string:"This is a test") voice.speakUtterance(utterance) } }