【发布时间】:2016-02-28 15:13:42
【问题描述】:
所以我在 swift 2.0 Xcode 7.1.1 上有一个完美的 AVSpeechSynthesizer(文本到语音),但我不知道如何让它像我们以正常速度甚至更慢的速度说话? 代码:
import UIKit
import AVKit
import AVFoundation
class HomePage: UIViewController {
let Voice = AVSpeechSynthesizer()
override func viewDidLoad() {
super.viewDidLoad()
let TilteSpeakingText1 = AVSpeechUtterance(string: "Welcome back. The database should still be up for you")
Voice.speakUtterance(TilteSpeakingText1)
TilteSpeakingText1.rate = 0.003
TilteSpeakingText1.pitchMultiplier = 0.60
TilteSpeakingText1.volume = 0.75
TilteSpeakingText1.postUtteranceDelay = 0.01
}
}
【问题讨论】:
-
您是在设备上还是在 SIM 卡上?设置应用中的语速设置有影响吗? i.imgur.com/BImbqfJ.png
-
@MattLong,设置中的语速设置在哪里?我找不到它。
-
常规 > 辅助功能 > 语音
标签: ios xcode swift avspeechsynthesizer