SWIFT新手,网上查到以下代码,在xcode中运行正常,模拟器有声,在我的iphone se手机上执行没有念出声音,能帮忙想想什么原因嘛?
xcode8 ios10.2
let synthesizer = AVSpeechSynthesizer();
var utterance = AVSpeechUtterance(string: "")
utterance = AVSpeechUtterance(string: "世界你好")
utterance.voice = AVSpeechSynthesisVoice(language:"zh-CN")
utterance.rate = 0.6
synthesizer.speak(utterance)
xcode8 ios10.2
let synthesizer = AVSpeechSynthesizer();
var utterance = AVSpeechUtterance(string: "")
utterance = AVSpeechUtterance(string: "世界你好")
utterance.voice = AVSpeechSynthesisVoice(language:"zh-CN")
utterance.rate = 0.6
synthesizer.speak(utterance)