所有 当我在模拟器中运行时,我使用我的项目AVSpeechUtterance进行文本到语音的工作正常但是当我在我的设备中运行语音音量很慢时,我的代码...
let utterance = AVSpeechUtterance(string: "Good night all")
if UserDefaults.standard.string(forKey: "LNG") == "Eng"
{
utterance.voice = AVSpeechSynthesisVoice(language: "en-US")
}
else
{
utterance.voice = AVSpeechSynthesisVoice(language: "de-DE")
}
utterance.rate = AVSpeechUtteranceDefaultSpeechRate
utterance.volume = 1
let synth = AVSpeechSynthesizer()
synth.speak(utterance)